<?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 Set analysis or if with measures. in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343781#M29718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;I'm working on an app that makes me problem. The goal is to have a kpi that counts the worker that have sold "type a" things, and their sales of last year are stricly lower than sales of this year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data are those:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load*Inline&lt;/P&gt;&lt;P&gt;[worker,workerid&lt;/P&gt;&lt;P&gt;a,1&lt;/P&gt;&lt;P&gt;b,2&lt;/P&gt;&lt;P&gt;c,3&lt;/P&gt;&lt;P&gt;d,4&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*Inline&lt;/P&gt;&lt;P&gt;[workerid,sale,type,year&lt;/P&gt;&lt;P&gt;1,5,a,2016&lt;/P&gt;&lt;P&gt;1,4,a,2017&lt;/P&gt;&lt;P&gt;2,1,a,2016&lt;/P&gt;&lt;P&gt;2,8,a,2017&lt;/P&gt;&lt;P&gt;3,9,a,2016&lt;/P&gt;&lt;P&gt;3,2,a,2017&lt;/P&gt;&lt;P&gt;3,1,a,2017&lt;/P&gt;&lt;P&gt;4,4,a,2017&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Putting on a table, with the if clause it is all fine, but in a KPI, it does not work and I do not know why.&lt;/P&gt;&lt;P&gt;The formulae of the kpi are&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if( sum({$&amp;lt;type={"a"},year={"2016"}&amp;gt;}sale) &amp;gt; sum({$&amp;lt;type={"a"},year={"2017"}&amp;gt;}sale) ,count(workerid),0 )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;set&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;type={"a"},year={"2016"},workerid={"$(sum({$&amp;lt;type={"a"},year={"2016"}&amp;gt;}sale) &amp;gt; sum({$&amp;lt;type={"a"},year={"2017"}&amp;gt;}sale))"}&amp;gt;}workerid)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="kpi.PNG" class="jive-image image-1" height="469" src="https://community.qlik.com/legacyfs/online/172347_kpi.PNG" style="height: 469.065px; width: 740px;" width="740" /&gt;&lt;/P&gt;&lt;P&gt;I've attached the app.&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Aug 2017 09:07:06 GMT</pubDate>
    <dc:creator>simotrab</dc:creator>
    <dc:date>2017-08-03T09:07:06Z</dc:date>
    <item>
      <title>Set analysis or if with measures.</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343781#M29718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;I'm working on an app that makes me problem. The goal is to have a kpi that counts the worker that have sold "type a" things, and their sales of last year are stricly lower than sales of this year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data are those:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load*Inline&lt;/P&gt;&lt;P&gt;[worker,workerid&lt;/P&gt;&lt;P&gt;a,1&lt;/P&gt;&lt;P&gt;b,2&lt;/P&gt;&lt;P&gt;c,3&lt;/P&gt;&lt;P&gt;d,4&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*Inline&lt;/P&gt;&lt;P&gt;[workerid,sale,type,year&lt;/P&gt;&lt;P&gt;1,5,a,2016&lt;/P&gt;&lt;P&gt;1,4,a,2017&lt;/P&gt;&lt;P&gt;2,1,a,2016&lt;/P&gt;&lt;P&gt;2,8,a,2017&lt;/P&gt;&lt;P&gt;3,9,a,2016&lt;/P&gt;&lt;P&gt;3,2,a,2017&lt;/P&gt;&lt;P&gt;3,1,a,2017&lt;/P&gt;&lt;P&gt;4,4,a,2017&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Putting on a table, with the if clause it is all fine, but in a KPI, it does not work and I do not know why.&lt;/P&gt;&lt;P&gt;The formulae of the kpi are&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if( sum({$&amp;lt;type={"a"},year={"2016"}&amp;gt;}sale) &amp;gt; sum({$&amp;lt;type={"a"},year={"2017"}&amp;gt;}sale) ,count(workerid),0 )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;set&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;type={"a"},year={"2016"},workerid={"$(sum({$&amp;lt;type={"a"},year={"2016"}&amp;gt;}sale) &amp;gt; sum({$&amp;lt;type={"a"},year={"2017"}&amp;gt;}sale))"}&amp;gt;}workerid)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="kpi.PNG" class="jive-image image-1" height="469" src="https://community.qlik.com/legacyfs/online/172347_kpi.PNG" style="height: 469.065px; width: 740px;" width="740" /&gt;&lt;/P&gt;&lt;P&gt;I've attached the app.&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2017 09:07:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343781#M29718</guid>
      <dc:creator>simotrab</dc:creator>
      <dc:date>2017-08-03T09:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis or if with measures.</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343782#M29719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Simone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(aggr(Sum ({&amp;lt;year={'Max(year)'}&amp;gt;}Sale),&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[workerid,type)&lt;/SPAN&gt;)-(&lt;SPAN style="font-size: 13.3333px;"&gt;aggr(Sum ({&amp;lt;year={'Max(year)-1'}&amp;gt;}Sale),&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[workerid,type&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;))&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Arvind Patil&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2017 09:17:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343782#M29719</guid>
      <dc:creator>arvind_patil</dc:creator>
      <dc:date>2017-08-03T09:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis or if with measures.</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343783#M29720</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;Try This,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({&amp;lt;workerid={"=sum({$&amp;lt;type={'a'},year={'2016'}&amp;gt;}sale)&amp;gt;sum({$&amp;lt;type={'a'},year={'2017'}&amp;gt;}sale)"}&amp;gt;}distinct workerid)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2017 09:41:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343783#M29720</guid>
      <dc:creator>pathiqvd</dc:creator>
      <dc:date>2017-08-03T09:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis or if with measures.</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343784#M29721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arvind,&lt;/P&gt;&lt;P&gt;thanks but unluckily it does not work, also because it sign errors. I've tried to correct them but the result is not useful&lt;/P&gt;&lt;P&gt;(to remove complexity, the year is a constant now, your solution were more elegant clearly)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(Sum ({&amp;lt;year={"2017"}&amp;gt;}sale),[workerid,type])-aggr(Sum ({&amp;lt;year={"2016"}&amp;gt;}sale),[workerid,type])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2017 09:42:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343784#M29721</guid>
      <dc:creator>simotrab</dc:creator>
      <dc:date>2017-08-03T09:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis or if with measures.</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343785#M29722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try&lt;/P&gt;&lt;P&gt;count({&amp;lt;type={a},workerid={"=sum({&amp;lt;Year={2016}&amp;gt;}sale) &amp;gt; sum({&amp;lt;Year={2017}&amp;gt;}sale))"}&amp;gt;}workerid)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Aug 2017 17:26:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343785#M29722</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2017-08-05T17:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis or if with measures.</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343786#M29723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simone,&lt;/P&gt;&lt;P&gt;You can try this by creating a flag in script.&lt;/P&gt;&lt;P&gt;Please find attached solution which is in qlikview.&lt;/P&gt;&lt;P&gt;but, the script will remain same for both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pankaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Aug 2017 19:30:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-or-if-with-measures/m-p/1343786#M29723</guid>
      <dc:creator>passionate</dc:creator>
      <dc:date>2017-08-05T19:30:58Z</dc:date>
    </item>
  </channel>
</rss>

