<?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 Sense: Using a variable in set analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sense-Using-a-variable-in-set-analysis/m-p/1695251#M53164</link>
    <description>&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;I have two variables in my script:&lt;/P&gt;&lt;P&gt;LET vYearMonthCurrent = '=Max(YearMonth)';&lt;BR /&gt;LET vYearMonthPrevious = '=Date(Addyears(Max(Id_Date), -1), '&amp;amp;chr(39)&amp;amp;'YYYY-MMM'&amp;amp;chr(39)&amp;amp;')';&lt;/P&gt;&lt;P&gt;And I'm using the first one in a graph in set analysis in this expression:&lt;/P&gt;&lt;P&gt;SUM ({&amp;lt;YearMonth= {"$(vYearMonthCurrent)"} &amp;gt;}VALUE)&lt;BR /&gt;+&lt;BR /&gt;SUM ({&amp;lt;YearMonth= {"$(vYearMonthCurrent)"} &amp;gt;}VALUE_AC)&lt;/P&gt;&lt;P&gt;It works just fine.&lt;/P&gt;&lt;P&gt;But if I want to use the variable with the previous year&amp;amp;month and do this:&lt;/P&gt;&lt;P&gt;SUM ({&amp;lt;YearMonth= {"$(vYearMonthPrevious )"} &amp;gt;}VALUE)&lt;BR /&gt;+&lt;BR /&gt;SUM ({&amp;lt;YearMonth= {"$(vYearMonthPrevious )"} &amp;gt;}VALUE_AC)&lt;/P&gt;&lt;P&gt;It shows 0.&lt;/P&gt;&lt;P&gt;Do you know why this happens?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rita&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 02:37:44 GMT</pubDate>
    <dc:creator>Ri_ta</dc:creator>
    <dc:date>2024-11-16T02:37:44Z</dc:date>
    <item>
      <title>Sense: Using a variable in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Sense-Using-a-variable-in-set-analysis/m-p/1695251#M53164</link>
      <description>&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;I have two variables in my script:&lt;/P&gt;&lt;P&gt;LET vYearMonthCurrent = '=Max(YearMonth)';&lt;BR /&gt;LET vYearMonthPrevious = '=Date(Addyears(Max(Id_Date), -1), '&amp;amp;chr(39)&amp;amp;'YYYY-MMM'&amp;amp;chr(39)&amp;amp;')';&lt;/P&gt;&lt;P&gt;And I'm using the first one in a graph in set analysis in this expression:&lt;/P&gt;&lt;P&gt;SUM ({&amp;lt;YearMonth= {"$(vYearMonthCurrent)"} &amp;gt;}VALUE)&lt;BR /&gt;+&lt;BR /&gt;SUM ({&amp;lt;YearMonth= {"$(vYearMonthCurrent)"} &amp;gt;}VALUE_AC)&lt;/P&gt;&lt;P&gt;It works just fine.&lt;/P&gt;&lt;P&gt;But if I want to use the variable with the previous year&amp;amp;month and do this:&lt;/P&gt;&lt;P&gt;SUM ({&amp;lt;YearMonth= {"$(vYearMonthPrevious )"} &amp;gt;}VALUE)&lt;BR /&gt;+&lt;BR /&gt;SUM ({&amp;lt;YearMonth= {"$(vYearMonthPrevious )"} &amp;gt;}VALUE_AC)&lt;/P&gt;&lt;P&gt;It shows 0.&lt;/P&gt;&lt;P&gt;Do you know why this happens?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rita&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:37:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sense-Using-a-variable-in-set-analysis/m-p/1695251#M53164</guid>
      <dc:creator>Ri_ta</dc:creator>
      <dc:date>2024-11-16T02:37:44Z</dc:date>
    </item>
  </channel>
</rss>

