<?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 Dimension ignored by variable in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Dimension-ignored-by-variable/m-p/1682403#M51950</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have an issue using a variable in of the measure in the Table object.&amp;nbsp;The calculation behaves kind of strange to me.&lt;/P&gt;&lt;P&gt;&lt;U&gt;Here are the variable definitions:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vCusAvgRevLThreeMonths&lt;/STRONG&gt; = sum({$&amp;lt;$(vIgnoreDateFieldsSelection),Revenues_flag={'YES'}, MonthsAgo={2,3,4}&amp;gt;}$(vAmount))/3&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vLastMonthRevenue&lt;/STRONG&gt; =&amp;nbsp;&amp;nbsp;Sum({&amp;lt;$(vIgnoreDateFieldsSelection),MonthsAgo={1},Revenues_flag={'YES'}&amp;gt;}$(vAmount))&lt;/P&gt;&lt;P&gt;*vIgnoreDateFieldsSelection includes just the date fields names seperated by commas - in order to ignore selections in these fields&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Here are the measure definitions:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Cus. Avg Revenue - 3 Months before Last Month&lt;/STRONG&gt; =&lt;/P&gt;&lt;P&gt;num($(vCusAvgRevLThreeMonths), $(vCurrencyPattern))&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Last Month Revenue&lt;/STRONG&gt; =&lt;/P&gt;&lt;P&gt;num($(vLastMonthRevenue),$(vCurrencyPattern))&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Customer Trend Percentage&lt;/STRONG&gt; =&lt;/P&gt;&lt;P&gt;if($(vLastMonthRevenue) &amp;lt; 0 or $(vCusAvgRevLThreeMonths) &amp;lt; 0,&lt;BR /&gt;null(),&lt;BR /&gt;$(vLastMonthRevenue)/$(vCusAvgRevLThreeMonths)-1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table gives me these results which are not matching to each other - Customer Trend Percentage is incorrect (correct result should be 0.11%&lt;/P&gt;&lt;P&gt;Customer Name |&amp;nbsp;Cus. Avg Revenue - 3 Months before Last Month | Last Month Revenue | Customer Trend Percentage&lt;/P&gt;&lt;P&gt;Customer A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 14 320&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; &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; &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;| 14 337&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;| -88.88%&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RESULT OK&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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RESULT OK&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; INCORRECT RESULT&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is strange though, that solution seems to be to wrap&amp;nbsp;&lt;STRONG&gt;vCusAvgRevLThreeMonths&amp;nbsp;&lt;/STRONG&gt;variable in aggr() function with Customer Name used in it. But why does this work? It would make sense to me that, then I would have to do the same thing with&amp;nbsp;&lt;STRONG&gt;vLastMonthRevenue &lt;/STRONG&gt;variable too, but that doesn't seem to be necessary. How exactly Qlik Sense calculates this?&lt;/P&gt;&lt;P&gt;Any ideas are more than welcome. Maybe, I am missing something very trivial.&lt;/P&gt;&lt;P&gt;Thanks a lot. Have a great day.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 03:03:47 GMT</pubDate>
    <dc:creator>onmysi49</dc:creator>
    <dc:date>2024-11-16T03:03:47Z</dc:date>
    <item>
      <title>Dimension ignored by variable</title>
      <link>https://community.qlik.com/t5/App-Development/Dimension-ignored-by-variable/m-p/1682403#M51950</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have an issue using a variable in of the measure in the Table object.&amp;nbsp;The calculation behaves kind of strange to me.&lt;/P&gt;&lt;P&gt;&lt;U&gt;Here are the variable definitions:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vCusAvgRevLThreeMonths&lt;/STRONG&gt; = sum({$&amp;lt;$(vIgnoreDateFieldsSelection),Revenues_flag={'YES'}, MonthsAgo={2,3,4}&amp;gt;}$(vAmount))/3&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vLastMonthRevenue&lt;/STRONG&gt; =&amp;nbsp;&amp;nbsp;Sum({&amp;lt;$(vIgnoreDateFieldsSelection),MonthsAgo={1},Revenues_flag={'YES'}&amp;gt;}$(vAmount))&lt;/P&gt;&lt;P&gt;*vIgnoreDateFieldsSelection includes just the date fields names seperated by commas - in order to ignore selections in these fields&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Here are the measure definitions:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Cus. Avg Revenue - 3 Months before Last Month&lt;/STRONG&gt; =&lt;/P&gt;&lt;P&gt;num($(vCusAvgRevLThreeMonths), $(vCurrencyPattern))&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Last Month Revenue&lt;/STRONG&gt; =&lt;/P&gt;&lt;P&gt;num($(vLastMonthRevenue),$(vCurrencyPattern))&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Customer Trend Percentage&lt;/STRONG&gt; =&lt;/P&gt;&lt;P&gt;if($(vLastMonthRevenue) &amp;lt; 0 or $(vCusAvgRevLThreeMonths) &amp;lt; 0,&lt;BR /&gt;null(),&lt;BR /&gt;$(vLastMonthRevenue)/$(vCusAvgRevLThreeMonths)-1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table gives me these results which are not matching to each other - Customer Trend Percentage is incorrect (correct result should be 0.11%&lt;/P&gt;&lt;P&gt;Customer Name |&amp;nbsp;Cus. Avg Revenue - 3 Months before Last Month | Last Month Revenue | Customer Trend Percentage&lt;/P&gt;&lt;P&gt;Customer A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 14 320&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; &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; &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;| 14 337&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;| -88.88%&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RESULT OK&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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RESULT OK&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; INCORRECT RESULT&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is strange though, that solution seems to be to wrap&amp;nbsp;&lt;STRONG&gt;vCusAvgRevLThreeMonths&amp;nbsp;&lt;/STRONG&gt;variable in aggr() function with Customer Name used in it. But why does this work? It would make sense to me that, then I would have to do the same thing with&amp;nbsp;&lt;STRONG&gt;vLastMonthRevenue &lt;/STRONG&gt;variable too, but that doesn't seem to be necessary. How exactly Qlik Sense calculates this?&lt;/P&gt;&lt;P&gt;Any ideas are more than welcome. Maybe, I am missing something very trivial.&lt;/P&gt;&lt;P&gt;Thanks a lot. Have a great day.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:03:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dimension-ignored-by-variable/m-p/1682403#M51950</guid>
      <dc:creator>onmysi49</dc:creator>
      <dc:date>2024-11-16T03:03:47Z</dc:date>
    </item>
  </channel>
</rss>

