<?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: Error when creating age group in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258527#M97610</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you don't have the second "if" statement complete. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Qlikiview if is a ternary expression, and the third parameter is mandatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe this will load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MEM#,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Age &amp;gt;= 18, '&amp;gt;=18',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Age &amp;lt;= 17 and Age &amp;gt;= 0, '0-17','Other?')) as Age_Group&lt;/P&gt;&lt;P&gt;Resident mem;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if the "else" does not exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel Catalão&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jun 2011 17:06:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-06-01T17:06:16Z</dc:date>
    <item>
      <title>Error when creating age group</title>
      <link>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258525#M97608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;mem_age_tmp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MEM#,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Age &amp;gt;= 18, '&amp;gt;=18',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Age &amp;lt;= 17 and Age &amp;gt;= 0, '0-17')) as Age_Group&lt;/P&gt;&lt;P&gt;Resident mem;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to create a couple of Age_Group using the above code but I am getting an error when I run it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is wrong with the above code? Any help would be greatly appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 16:52:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258525#M97608</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-01T16:52:31Z</dc:date>
    </item>
    <item>
      <title>Error when creating age group</title>
      <link>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258526#M97609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, could you be more specific about the error thrown by QlikView, because your syntaxis looks alright to me. Also, when I create age groups, I always use the intervalmatch function within the script, or a calculated dimension using the class function within the GUI, I suggest to use one of those, depending on your requirement, since they are much easier to handle and mantain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 17:02:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258526#M97609</guid>
      <dc:creator />
      <dc:date>2011-06-01T17:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Error when creating age group</title>
      <link>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258527#M97610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you don't have the second "if" statement complete. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Qlikiview if is a ternary expression, and the third parameter is mandatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe this will load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MEM#,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Age &amp;gt;= 18, '&amp;gt;=18',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Age &amp;lt;= 17 and Age &amp;gt;= 0, '0-17','Other?')) as Age_Group&lt;/P&gt;&lt;P&gt;Resident mem;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if the "else" does not exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel Catalão&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 17:06:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258527#M97610</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-01T17:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error when creating age group</title>
      <link>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258528#M97611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, actually the third parameter is not mandatory, QV will evaluate to a null value in the case that a value does not meet the condition and the else parameter was not provided, but it will never be the source of a script error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 17:13:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258528#M97611</guid>
      <dc:creator />
      <dc:date>2011-06-01T17:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error when creating age group</title>
      <link>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258529#M97612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, you are right, just tested it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tested the full load expression with the chained "if"'s and it seems ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you debug the code and see where it stops?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 17:16:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258529#M97612</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-01T17:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error when creating age group</title>
      <link>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258530#M97613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again, is QV returning a general script error??, because sometimes I happen to write my code ok, and QV seems to find a unexistent error, what I do to solve is close QV completely and open it again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope tis helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 17:45:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258530#M97613</guid>
      <dc:creator />
      <dc:date>2011-06-01T17:45:35Z</dc:date>
    </item>
    <item>
      <title>Error when creating age group</title>
      <link>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258531#M97614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Ivan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error message is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error in expression:l')' expected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mem_age_tmp:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MEM#,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Age &amp;gt;=18,'&amp;gt;=18',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Age &amp;lt;= 17 and Age=&amp;gt;0,'0-17')) as Age_Group&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident mem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an FYI, Age is calculated in a load that ran previous to this. The table is calls mem. I listed the code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mem:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt; MEM#,&lt;/P&gt;&lt;P&gt; //MEM#,&lt;/P&gt;&lt;P&gt; //MEM# as Pharm_MEM#,&lt;/P&gt;&lt;P&gt; //MEM# as Med_MEM#,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DOB,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Age('12/31/2011',DOB) as Age,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [MED MONTHS], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [PHAR MONTHS], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [RAW ACG], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [PRE COST], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [PROB INP], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGGREGATE, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADDRESS, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CITY, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STATE, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ZIP CODE]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Data\Dimensions\mem.qvd &lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 18:01:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258531#M97614</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-01T18:01:16Z</dc:date>
    </item>
    <item>
      <title>Error when creating age group</title>
      <link>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258532#M97615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I see the error now, it seem obvious but is hard to see, the last greater or equal symbol is written as "=&amp;gt;" when the correct notation should be "&amp;gt;=".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 19:12:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258532#M97615</guid>
      <dc:creator />
      <dc:date>2011-06-01T19:12:42Z</dc:date>
    </item>
    <item>
      <title>Error when creating age group</title>
      <link>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258533#M97616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Ivan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was the problem. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 20:58:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-when-creating-age-group/m-p/258533#M97616</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-01T20:58:15Z</dc:date>
    </item>
  </channel>
</rss>

