<?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: Ignore filter in aggr expression in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Ignore-filter-in-aggr-expression/m-p/91730#M6107</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Managed to solve the problem after reading:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3779"&gt;Use Aggregation Functions!&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wrapped the [station] in the AGGR function with Only({1}station);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Sep 2018 08:23:04 GMT</pubDate>
    <dc:creator>rasmusnielsen</dc:creator>
    <dc:date>2018-09-21T08:23:04Z</dc:date>
    <item>
      <title>Ignore filter in aggr expression</title>
      <link>https://community.qlik.com/t5/App-Development/Ignore-filter-in-aggr-expression/m-p/91728#M6105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a KPI in my Qlik sense app with the following measure:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;Count(distinct &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;Aggr(nodistinct If(&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;Avg({1&amp;lt;date = {"$(vCompareDate1)"}, brand={"B1"}&amp;gt;} [discount]) &amp;gt; Avg({1&amp;lt;date = {"$(vCompareDate2)"}, brand={"B1"}&amp;gt;} [discount]), [station]), [station], [product]))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;My model looks like:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="174" style="border: 1px solid rgb(0, 0, 0); width: 149px; height: 149px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;date (date)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;station (string)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;product (string)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;brand (string)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;segment (string)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;discount (double)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the app the user can select two dates which are then stored into variables vCompareDate1 and vCompareDate2. The KPI should show the amount of unique stations that has a lower discount on vCompareDate2 compared to vCompareDate1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two filters: segment and product. I would like to make the KPI ignore the segment filter. But I have not been able to do so yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the following measures without any luck:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;Count(&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;{1}&lt;/STRONG&gt;&lt;/SPAN&gt;distinct &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;Aggr(nodistinct If(&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;Avg({1&amp;lt;date = {"$(vCompareDate1)"}, brand={"B1"}&amp;gt;} [discount]) &amp;gt; Avg({1&amp;lt;date = {"$(vCompareDate2)"}, brand={"B1"}&amp;gt;} [discount]), [station]), [station], [product]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;Count(&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;{&amp;lt;segment=&amp;gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;distinct &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;Aggr(nodistinct If(&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;Avg({1&amp;lt;date = {"$(vCompareDate1)"}, brand={"B1"}&amp;gt;} [discount]) &amp;gt; Avg({1&amp;lt;date = {"$(vCompareDate2)"}, brand={"B1"}&amp;gt;} [discount]), [station]), [station], [product]))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;Count(distinct &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;Aggr(nodistinct If(&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;Avg({1&amp;lt;date = {"$(vCompareDate1)"}, brand={"B1"}&lt;SPAN style="color: #ff0000;"&gt;, segment=&lt;/SPAN&gt;&amp;gt;} [discount]) &amp;gt; Avg({1&amp;lt;date = {"$(vCompareDate2)"}, brand={"B1"}&lt;SPAN style="color: #ff0000;"&gt;, segment=&lt;/SPAN&gt;&amp;gt;} [discount]), [station]), [station], [product]))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;Count(distinct &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;Aggr(nodistinct If(&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;Avg({&lt;SPAN style="color: #ff0000;"&gt;$&amp;lt;segment=&amp;gt;*&lt;/SPAN&gt;1&amp;lt;date = {"$(vCompareDate1)"}, brand={"B1"}&amp;gt;} [discount]) &amp;gt; Avg({&lt;SPAN style="color: #ff0000; font-family: 'andale mono', times; font-size: 16px;"&gt;$&amp;lt;segment=&amp;gt;*&lt;/SPAN&gt;1&amp;lt;date = {"$(vCompareDate2)"}, brand={"B1"}&amp;gt;} [discount]), [station]), [station], [product]))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;Count(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;segment=&amp;gt;}&lt;/SPAN&gt;distinct &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'andale mono', times;"&gt;Aggr(nodistinct If(&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;Avg({&lt;SPAN style="color: #ff0000;"&gt;$&amp;lt;segment=&amp;gt;*&lt;/SPAN&gt;1&amp;lt;date = {"$(vCompareDate1)"}, brand={"B1"}&amp;gt;} [discount]) &amp;gt; Avg({&lt;SPAN style="color: #ff0000; font-family: 'andale mono', times; font-size: 16px;"&gt;$&amp;lt;segment=&amp;gt;*&lt;/SPAN&gt;1&amp;lt;date = {"$(vCompareDate2)"}, brand={"B1"}&amp;gt;} [discount]), [station]), [station], [product]))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I am also using this measure inside a synthetic dimension, which is why I have the distinct / nodistint's, according to &lt;A href="http://www.naturalsynergies.com/q-tip-14-aggr-and-synthetic-dimensions/" title="http://www.naturalsynergies.com/q-tip-14-aggr-and-synthetic-dimensions/"&gt;http://www.naturalsynergies.com/q-tip-14-aggr-and-synthetic-dimensions/&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Any suggestions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 11:27:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Ignore-filter-in-aggr-expression/m-p/91728#M6105</guid>
      <dc:creator>rasmusnielsen</dc:creator>
      <dc:date>2018-09-20T11:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore filter in aggr expression</title>
      <link>https://community.qlik.com/t5/App-Development/Ignore-filter-in-aggr-expression/m-p/91729#M6106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was just wondering if my issue is that I don't have an aggregation function inside my aggr, but just the [station] dimension?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I can't see what an alternative approach would be?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2018 06:17:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Ignore-filter-in-aggr-expression/m-p/91729#M6106</guid>
      <dc:creator>rasmusnielsen</dc:creator>
      <dc:date>2018-09-21T06:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore filter in aggr expression</title>
      <link>https://community.qlik.com/t5/App-Development/Ignore-filter-in-aggr-expression/m-p/91730#M6107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Managed to solve the problem after reading:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3779"&gt;Use Aggregation Functions!&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wrapped the [station] in the AGGR function with Only({1}station);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2018 08:23:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Ignore-filter-in-aggr-expression/m-p/91730#M6107</guid>
      <dc:creator>rasmusnielsen</dc:creator>
      <dc:date>2018-09-21T08:23:04Z</dc:date>
    </item>
  </channel>
</rss>

