<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Make age, age range in script from SQL query in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Make-age-age-range-in-script-from-SQL-query/m-p/1164211#M634542</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes is stupid mistake&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/x.png" /&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 29 May 2016 17:54:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-05-29T17:54:44Z</dc:date>
    <item>
      <title>Make age, age range in script from SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/Make-age-age-range-in-script-from-SQL-query/m-p/1164208#M634539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gurus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I know to add age column in script, but next problem in &lt;SPAN style="text-decoration: underline;"&gt;age range&lt;/SPAN&gt; in script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; *,&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;age&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BirthDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Age&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; SELECT AddressLine1,&lt;BR /&gt; CustomerKey,&lt;BR /&gt; DateFirstPurchase,&lt;BR /&gt; EmailAddress,&lt;BR /&gt; EnglishEducation,&lt;BR /&gt; FirstName,&lt;BR /&gt; LastName,&lt;BR /&gt; Gender,&lt;BR /&gt; Phone,&lt;BR /&gt; BirthDate&lt;BR /&gt; FROM AdventureWorksDW2014.dbo.DimCustomer; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Now this scrip make new column as AGE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;but if I use this script is not working:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; *,&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;age&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BirthDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Age&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;age&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BirthDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;lt;=25,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;dual&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('&amp;lt;=25'),&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;age&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BirthDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;lt;=50,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;dual&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('26-50'),&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;age&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BirthDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;lt;=60,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;dual&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('51-60'),&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;age&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;birthdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;gt;60,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;dual&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ('60+'))))) as AgeRange ; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Error in expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Dual takes 2 parameters&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Where problem ??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 May 2016 17:05:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Make-age-age-range-in-script-from-SQL-query/m-p/1164208#M634539</guid>
      <dc:creator />
      <dc:date>2016-05-28T17:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Make age, age range in script from SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/Make-age-age-range-in-script-from-SQL-query/m-p/1164209#M634540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Age(Today(), BirthDate) as Age,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Age(Today(), BirthDate) &amp;lt;= 25, Dual('&amp;lt;=25'&lt;SPAN style="color: #ff0000;"&gt;, 1&lt;/SPAN&gt;),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Age(Today(), BirthDate)&amp;lt;= 50, Dual('26-50'&lt;SPAN style="color: #ff0000;"&gt;, 2&lt;/SPAN&gt;),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Age(Today(), BirthDate)&amp;lt;= 60, Dual('51-60'&lt;SPAN style="color: #ff0000;"&gt;, 3&lt;/SPAN&gt;),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Age(Today(), BirthDate) &amp;gt; 60, Dual('60+'&lt;SPAN style="color: #ff0000;"&gt;, 4&lt;/SPAN&gt;))))) as AgeRange;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SQL SELECT AddressLine1,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CustomerKey,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;DateFirstPurchase,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;EmailAddress,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;EnglishEducation,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;FirstName,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;LastName,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Gender,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Phone,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;BirthDate&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;FROM AdventureWorksDW2014.dbo.DimCustomer;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 May 2016 23:05:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Make-age-age-range-in-script-from-SQL-query/m-p/1164209#M634540</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-28T23:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Make age, age range in script from SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/Make-age-age-range-in-script-from-SQL-query/m-p/1164210#M634541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you encounter this kind of errors when executing the script, it's actually helpful to hit the HELP key and lookup the&amp;nbsp; function:&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/FormattingFunctions/Dual.htm" title="http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/FormattingFunctions/Dual.htm"&gt;Dual ‒ QlikView&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, you will clearly see the number of arguments required and expected:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1 data-mc-conditions="Primary.NotToTranslate" style="font-size: 1.714em; margin: 0 0 10px; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif;"&gt;Dual - script and chart function&lt;/H1&gt;&lt;P style="font-size: 14px; margin: 10px 0; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif;"&gt;&lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate" style="font-weight: bold;"&gt;Dual()&lt;/SPAN&gt; combines a number and a string into a single record, such that the number representation of the record can be used for sorting and calculation purposes, while the string value can be used for display purposes&lt;/P&gt;&lt;P class="syntax_heading" data-mc-autonum="Syntax: " style="font-size: 14px; margin: 10px 0; font-weight: bold; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif;"&gt;&lt;SPAN class="autonumber"&gt;Syntax: &lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate" style="font-size: 12px; margin: 10px 0; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; color: #0f0f0f; background-color: #f4f4f4;"&gt;&lt;SPAN class="statement" style="font-weight: bold;"&gt;Dual(&lt;/SPAN&gt;text, number&lt;SPAN class="statement" style="font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="return_type" data-mc-autonum="Return data type: " style="font-size: 14px; margin: 10px 0; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif;"&gt;&lt;SPAN class="autonumber" style="font-weight: bold;"&gt;Return data type: &lt;/SPAN&gt;dual&lt;/P&gt;&lt;P class="arguments" data-mc-autonum="Arguments: " style="font-size: 14px; margin: 10px 0; font-weight: bold; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif;"&gt;&lt;SPAN class="autonumber"&gt;Arguments: &lt;/SPAN&gt; &lt;/P&gt;&lt;TABLE cellspacing="0" class="TableStyle-tableGrid" style="margin-bottom: 15px; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; margin-right: auto;"&gt;&lt;THEAD style="border-top-width: 2px; border-top-style: solid; border-top-color: #0f0f0f;"&gt;&lt;TR class="Head-Header1"&gt;&lt;TH class="HeadI--" style="padding: 5px 7px;"&gt;Argument&lt;/TH&gt;&lt;TH class="HeadG--" style="padding: 5px 7px;"&gt;Description&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY style="border-top-width: 2px; border-top-color: #0f0f0f;"&gt;&lt;TR class="Body-Body1" style="border-bottom-width: 1px; border-bottom-color: #d5d5d5;"&gt;&lt;TD class="BodyI--" data-mc-conditions="Primary.NotToTranslate" style="padding: 7px; border: 1px solid #d5d5d5;"&gt;text&lt;/TD&gt;&lt;TD class="BodyG--" style="padding: 7px; border: 1px solid #d5d5d5;"&gt;The string value to be used in combination with the number argument.&lt;/TD&gt;&lt;/TR&gt;&lt;TR class="Body-Body1" style="border-bottom-width: 1px; border-bottom-color: #d5d5d5;"&gt;&lt;TD class="BodyC--" data-mc-conditions="Primary.NotToTranslate" style="padding: 7px; border: 1px solid #d5d5d5;"&gt;number&lt;/TD&gt;&lt;TD class="BodyA--" style="padding: 7px; border: 1px solid #d5d5d5;"&gt;The number to be used in combination with the string in the string argument.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-size: 14px; margin: 10px 0; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif;"&gt;In &lt;SPAN class="PrimaryGenericName"&gt;QlikView&lt;/SPAN&gt;, all field values are potentially dual values. This means that the field values can have both a numeric value and a textual value. An example is a date that could have a numeric value of 40908 and the textual representation ‘2011-12-31’.&lt;/P&gt;&lt;P style="font-size: 14px; margin: 10px 0; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif;"&gt;When several data items read into one field have different string representations but the same valid number representation, they will all share the first string representation encountered.&lt;/P&gt;&lt;P class="tip" style="padding: 10px 10px 10px 55px; margin-bottom: 10px; margin-top: 10px; border-left-width: 3px; border-left-style: solid; border-left-color: #6eb43f; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; background: #f4f4f4;"&gt;The &lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate" style="font-weight: bold;"&gt;dual&lt;/SPAN&gt; function is typically used early in the script, before other data is read into the field concerned, in order to create that first string representation, which will be shown in list boxes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 May 2016 23:53:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Make-age-age-range-in-script-from-SQL-query/m-p/1164210#M634541</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-05-28T23:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Make age, age range in script from SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/Make-age-age-range-in-script-from-SQL-query/m-p/1164211#M634542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes is stupid mistake&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/x.png" /&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 May 2016 17:54:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Make-age-age-range-in-script-from-SQL-query/m-p/1164211#M634542</guid>
      <dc:creator />
      <dc:date>2016-05-29T17:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Make age, age range in script from SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/Make-age-age-range-in-script-from-SQL-query/m-p/1164212#M634543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank now is work&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 May 2016 17:55:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Make-age-age-range-in-script-from-SQL-query/m-p/1164212#M634543</guid>
      <dc:creator />
      <dc:date>2016-05-29T17:55:35Z</dc:date>
    </item>
  </channel>
</rss>

