<?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 Need Help in Set Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-Help-in-Set-Expression/m-p/1316392#M822793</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create an adhoc report which has multiple dimensions and expressions.Out of all expression in one of the expression i needed to calculate sales of Current month&amp;nbsp; - Previous Month.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Eg. If i select branch it will show all branch by default with Current / Max month sales - Previous month sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in list of dimensions i have Year and month as well. For Year by default it should show all Years with&amp;nbsp; following conditions&lt;/P&gt;&lt;P&gt;Eg. I have two year then it should show&lt;/P&gt;&lt;P&gt;Year&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales&lt;/P&gt;&lt;P&gt;2017&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(Month)-Max(Month)-1&lt;/P&gt;&lt;P&gt;2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;Max(Month)-Max(Month)-1...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;and For Month it should show all months data by default with following conditions -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Eg. considering my&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;July&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt; July's Sales - June's Sales (for all years since no year selected) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;June&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; June's Sales-May's Sales&amp;nbsp; ...and so on.&lt;/SPAN&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;&lt;SPAN style="font-size: 13.3333px;"&gt;How can i achieve this ? Attaching a sample data to work around&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks In advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>md_qlikview</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Need Help in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Need-Help-in-Set-Expression/m-p/1316392#M822793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create an adhoc report which has multiple dimensions and expressions.Out of all expression in one of the expression i needed to calculate sales of Current month&amp;nbsp; - Previous Month.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Eg. If i select branch it will show all branch by default with Current / Max month sales - Previous month sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in list of dimensions i have Year and month as well. For Year by default it should show all Years with&amp;nbsp; following conditions&lt;/P&gt;&lt;P&gt;Eg. I have two year then it should show&lt;/P&gt;&lt;P&gt;Year&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales&lt;/P&gt;&lt;P&gt;2017&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(Month)-Max(Month)-1&lt;/P&gt;&lt;P&gt;2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;Max(Month)-Max(Month)-1...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;and For Month it should show all months data by default with following conditions -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Eg. considering my&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;July&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt; July's Sales - June's Sales (for all years since no year selected) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;June&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; June's Sales-May's Sales&amp;nbsp; ...and so on.&lt;/SPAN&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;&lt;SPAN style="font-size: 13.3333px;"&gt;How can i achieve this ? Attaching a sample data to work around&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks In advance.&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/Need-Help-in-Set-Expression/m-p/1316392#M822793</guid>
      <dc:creator>md_qlikview</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Need-Help-in-Set-Expression/m-p/1316393#M822794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Milind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to create a variable as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vLastMonthsale = Sum({&amp;lt;Month = Month(Today())&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;Let vThisMonthsale = Sum({&amp;lt;Month = AddMonths(Month(Today())-1&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now use this formula for your scenario.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;July&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;July's Sales - June's Sales (for all years since no year selected)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;June&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;June's Sales-May's Sales &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have do this for rest of the month and you can go up till end of last year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;Karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jul 2017 07:15:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-Help-in-Set-Expression/m-p/1316393#M822794</guid>
      <dc:creator>karthikoffi27se</dc:creator>
      <dc:date>2017-07-31T07:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Need-Help-in-Set-Expression/m-p/1316394#M822795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Karthik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnx for your reply but I am not getting desired output&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jul 2017 08:13:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-Help-in-Set-Expression/m-p/1316394#M822795</guid>
      <dc:creator>md_qlikview</dc:creator>
      <dc:date>2017-07-31T08:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Need-Help-in-Set-Expression/m-p/1316395#M822796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Milind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use below script to calculate variance at Monthyear,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aggr_MOnth:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthYear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Sales) &lt;/P&gt;&lt;P&gt;FROM [lib://SalesData/Sales.qvd]&lt;/P&gt;&lt;P&gt;(qvd) Group By MonthYear&lt;/P&gt;&lt;P&gt;Order by MonthYear;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN(Aggr_MOnth)&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;MonthYear,&lt;/P&gt;&lt;P&gt;Previous(Sales) as PMSales&lt;/P&gt;&lt;P&gt;Resident Aggr_MOnth;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FinalSalesVariance:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;MonthYear,&lt;/P&gt;&lt;P&gt;(Sales - PMSales) as SalesVariance,&lt;/P&gt;&lt;P&gt;PMSales,&lt;/P&gt;&lt;P&gt;Sales&lt;/P&gt;&lt;P&gt;Resident Aggr_MOnth;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Aggr_MOnth;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:&lt;/P&gt;&lt;P&gt;You can also have others data gran in the group by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nirav Bhimani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jul 2017 09:36:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-Help-in-Set-Expression/m-p/1316395#M822796</guid>
      <dc:creator>nirav_bhimani</dc:creator>
      <dc:date>2017-07-31T09:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Need-Help-in-Set-Expression/m-p/1316396#M822797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nirav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnx for reply. Will check and let you know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jul 2017 09:40:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-Help-in-Set-Expression/m-p/1316396#M822797</guid>
      <dc:creator>md_qlikview</dc:creator>
      <dc:date>2017-07-31T09:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Need-Help-in-Set-Expression/m-p/1316397#M822798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Milind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, try using this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;Let vLastMonthsale = Sum({&amp;lt;Month = {$=(Month(Today()))}&amp;gt;}Sales)&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;Let vThisMonthsale = Sum({&amp;lt;Month = {$=(AddMonths(Month(Today())-1)}&amp;gt;}Sales)&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;or trying using Nirav solution but I personally prefer not to bring in the aggregation down to script due to&amp;nbsp; impact on load efficiency.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2017 04:59:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-Help-in-Set-Expression/m-p/1316397#M822798</guid>
      <dc:creator>karthikoffi27se</dc:creator>
      <dc:date>2017-08-01T04:59:39Z</dc:date>
    </item>
  </channel>
</rss>

