<?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: Month Wise Comparison in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965517#M79574</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Can You Explain through any example Or small data which Contain dates?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 06 Aug 2022 16:21:45 GMT</pubDate>
    <dc:creator>Sharad02</dc:creator>
    <dc:date>2022-08-06T16:21:45Z</dc:date>
    <item>
      <title>Month Wise Comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965235#M79551</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I Am trying to Solve this Month wise comparison that I have share it&amp;nbsp; Below.&lt;/P&gt;
&lt;P&gt;Like If we choose Jan we only compare with january sales , if we choose Feb then it compare with&amp;nbsp; Jan and feb both.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 275px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/86078iCF35CD52EC9558B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 13:47:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965235#M79551</guid>
      <dc:creator>Sharad02</dc:creator>
      <dc:date>2022-08-05T13:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Month Wise Comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965436#M79564</link>
      <description>&lt;P&gt;hi it is not clear what we are comparing and what the issue is.&amp;nbsp; maybe you can elaborate.&amp;nbsp; also is this the input data or the expected output?&amp;nbsp; what are the rules?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 20:23:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965436#M79564</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-08-05T20:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Month Wise Comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965498#M79571</link>
      <description>&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="p_1.PNG" style="width: 638px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/86138iD326A337CC70CF2D/image-dimensions/638x351?v=v2" width="638" height="351" role="button" title="p_1.PNG" alt="p_1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Above, I want '&lt;STRONG&gt;record No&lt;/STRONG&gt; and&lt;STRONG&gt; Line&lt;/STRONG&gt; Should be in the Form Of&amp;nbsp; given Below ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 275px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/86140i39A0D618927109EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had used below script for first Case Suggest me How to get the required output in second Pic.&lt;/P&gt;
&lt;P&gt;MaxYearMonthTable:&lt;BR /&gt;Load &lt;BR /&gt;Month(Max(date(Date,'DD/MM/YYYY'))) as Maxmonth,&lt;BR /&gt;Year(Max(date(Date,'DD/MM/YYYY'))) as MaxYear&lt;BR /&gt;Resident Fact_Table_1;&lt;/P&gt;
&lt;P&gt;Let vMaxYear=peek('MaxYear',0,'MaxYearMonthTable');&lt;BR /&gt;Let vMaxMonth=peek('Maxmonth',0,'MaxYearMonthTable');&lt;/P&gt;
&lt;P&gt;SpendmaxYearTable:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Load *&lt;BR /&gt;Resident Fact_Table_1&lt;BR /&gt;Where Year(Date(Date,'DD/MM/YYYY'))=$(vMaxYear);&lt;/P&gt;
&lt;P&gt;Calender:&lt;BR /&gt;Load &lt;BR /&gt;RecNo() as Record_No,&lt;BR /&gt;Date(AddMonths(makedate($(vMaxYear),1,1),recNo()-1),'YYYYMM') as CalYearMonth&lt;BR /&gt;AutoGenerate 12 ;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Left Join &lt;BR /&gt;Load&lt;BR /&gt;Record_No as Line,&lt;BR /&gt;CalYearMonth as calYearMonth2&lt;BR /&gt;resident Calender;&lt;/P&gt;
&lt;P&gt;inner join (SpendmaxYearTable)&lt;/P&gt;
&lt;P&gt;Load &lt;BR /&gt;Num(CalYearMonth) as YearMonth,&lt;BR /&gt;Num(CalYearMonth) as YearMonth2&lt;BR /&gt;Resident Calender&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Aug 2022 11:26:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965498#M79571</guid>
      <dc:creator>Sharad02</dc:creator>
      <dc:date>2022-08-06T11:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Month Wise Comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965506#M79572</link>
      <description>&lt;P&gt;it sounds like you want a month to compare to year to month.&amp;nbsp; i would solve this by creating a bridge.&amp;nbsp; your fact will have your monthly data, the bridge will connect your calendar to the fact.&amp;nbsp; when the user selects a month in the calendar, all year to month records in the fact will be selectable.&lt;/P&gt;
&lt;P&gt;assuming your date field in the FACT is Date, your calendar date field is CalYearMonth, your bridge will look like this:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;Date&lt;/TD&gt;
&lt;TD width="50%"&gt;CalMonthYear&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;202201&lt;/TD&gt;
&lt;TD width="50%"&gt;202201&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;202201&lt;/TD&gt;
&lt;TD width="50%"&gt;202202&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;202202&lt;/TD&gt;
&lt;TD width="50%"&gt;202202&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;202201&lt;/TD&gt;
&lt;TD width="50%"&gt;202203&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;202202&lt;/TD&gt;
&lt;TD width="50%"&gt;202203&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG&gt;202203&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;202203&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;//this assumes you have a Fact and Calendar table with Date and CalYearMonth fields

//Date is YYYYMM format
noconcatenate
tmp: load distinct Date resident Fact;

//the following creates a cartesian join
inner join (tmp)
load Date as CalYearMonth resident tmp;

//the following builds the bridge
Bridge:
load * resident tmp where Date &amp;lt;= Month;

drop table tmp;&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 06 Aug 2022 12:53:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965506#M79572</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-08-06T12:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Month Wise Comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965507#M79573</link>
      <description>&lt;P&gt;this assumes your user selects CalYearMonth and not Date&lt;/P&gt;
&lt;P&gt;you expressions should also use CalYearMonth&lt;/P&gt;</description>
      <pubDate>Sat, 06 Aug 2022 12:55:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965507#M79573</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-08-06T12:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Month Wise Comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965517#M79574</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Can You Explain through any example Or small data which Contain dates?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Aug 2022 16:21:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965517#M79574</guid>
      <dc:creator>Sharad02</dc:creator>
      <dc:date>2022-08-06T16:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Month Wise Comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965569#M79580</link>
      <description>&lt;P&gt;try it on your script, just change Fact to what you have - Fact_Table_1&lt;/P&gt;
&lt;P&gt;remove these lines and add the code i am suggesting:&lt;/P&gt;
&lt;P&gt;MaxYearMonthTable:&lt;BR /&gt;Load&lt;BR /&gt;Month(Max(date(Date,'DD/MM/YYYY'))) as Maxmonth,&lt;BR /&gt;Year(Max(date(Date,'DD/MM/YYYY'))) as MaxYear&lt;BR /&gt;Resident Fact_Table_1;&lt;/P&gt;
&lt;P&gt;Let vMaxYear=peek('MaxYear',0,'MaxYearMonthTable');&lt;BR /&gt;Let vMaxMonth=peek('Maxmonth',0,'MaxYearMonthTable');&lt;/P&gt;
&lt;P&gt;SpendmaxYearTable:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Load *&lt;BR /&gt;Resident Fact_Table_1&lt;BR /&gt;Where Year(Date(Date,'DD/MM/YYYY'))=$(vMaxYear);&lt;/P&gt;
&lt;P&gt;Left Join&lt;BR /&gt;Load&lt;BR /&gt;Record_No as Line,&lt;BR /&gt;CalYearMonth as calYearMonth2&lt;BR /&gt;resident Calender;&lt;/P&gt;
&lt;P&gt;inner join (SpendmaxYearTable)&lt;/P&gt;
&lt;P&gt;Load&lt;BR /&gt;Num(CalYearMonth) as YearMonth,&lt;BR /&gt;Num(CalYearMonth) as YearMonth2&lt;BR /&gt;Resident Calender&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2022 13:54:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Month-Wise-Comparison/m-p/1965569#M79580</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-08-07T13:54:31Z</dc:date>
    </item>
  </channel>
</rss>

