<?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: Invalid Expression in Script (if) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165947#M904406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.we need to use Group By in script when we are using aggregating functions like SUM,MIN,MAX,COUNT....&lt;/P&gt;&lt;P&gt;2.in group by we have to use all the dimensions using in the load statement.&lt;/P&gt;&lt;P&gt;3.for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD COUNTRY,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REGION,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(POPULATION)&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM TABLE.QVD&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; GROUP BY COUNTRY,REGION;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Nov 2016 07:21:40 GMT</pubDate>
    <dc:creator>omkarvamsi</dc:creator>
    <dc:date>2016-11-18T07:21:40Z</dc:date>
    <item>
      <title>Invalid Expression in Script (if)</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165942#M904401</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;Please see what is wrong with my syntax,&amp;nbsp; This exact formula works on the frontend but doesnt work in the script.&amp;nbsp; No idea why,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RAWTABLE:&lt;/P&gt;&lt;P&gt;Load Ticket Typ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RecSite&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load Count([Ticket Typ]) as TotalClaims,&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt; if(mid(RecSite,2,1)='F','Franchise','Corporate') as Type&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Resident RAWTABLE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Formula in question is in bold.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165942#M904401</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression in Script (if)</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165943#M904402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Function seems to be fine, though I do get the idea your are missing a "group by" to make that count work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2016 08:24:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165943#M904402</guid>
      <dc:creator>oknotsen</dc:creator>
      <dc:date>2016-07-04T08:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression in Script (if)</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165944#M904403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot use a Count() aggregation function and an individual field-that-isn't present-in-a-GROUP-BY clause in the same load. In addition to that, there is no GROUP BY clause. What are you planning to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2016 08:34:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165944#M904403</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-07-04T08:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression in Script (if)</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165945#M904404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All i need the count for is to do calculations on the frontend (Percentages).&amp;nbsp; So il just remove the code from the script and add it to the frontend.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2016 08:38:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165945#M904404</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-04T08:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression in Script (if)</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165946#M904405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For that I suggest you do that Type calculation (that IF statement) in your script and do the count in the front-end anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression to calculate your percentage will be something like this:&lt;/P&gt;&lt;P&gt;count([Ticket Type]) / count(TOTAL [Ticket Type]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2016 08:48:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165946#M904405</guid>
      <dc:creator>oknotsen</dc:creator>
      <dc:date>2016-07-04T08:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression in Script (if)</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165947#M904406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.we need to use Group By in script when we are using aggregating functions like SUM,MIN,MAX,COUNT....&lt;/P&gt;&lt;P&gt;2.in group by we have to use all the dimensions using in the load statement.&lt;/P&gt;&lt;P&gt;3.for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD COUNTRY,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REGION,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(POPULATION)&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM TABLE.QVD&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; GROUP BY COUNTRY,REGION;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 07:21:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165947#M904406</guid>
      <dc:creator>omkarvamsi</dc:creator>
      <dc:date>2016-11-18T07:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression in Script (if)</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165948#M904407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;Add Count(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[Ticket Typ]&lt;/SPAN&gt;) in&amp;nbsp; front end and keep you expression in&amp;nbsp; script as it is.&lt;/P&gt;&lt;P&gt;If you want to do it in script use by Groupby .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;if(mid(RecSite,2,1)='F','Franchise','Corporate') as Type&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident RAWTABLE&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 10:04:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-in-Script-if/m-p/1165948#M904407</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-18T10:04:23Z</dc:date>
    </item>
  </channel>
</rss>

