<?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: Previous and Current month data comparison in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940846#M324486</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data behind is huge about 2G and I cant transfer it to the site&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Dec 2015 06:29:22 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-12-04T06:29:22Z</dc:date>
    <item>
      <title>Previous and Current month data comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940842#M324482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the below issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the same dataset,&lt;/P&gt;&lt;P&gt;- Previous month, if the class is not equal to 'Legal'&lt;/P&gt;&lt;P&gt;- Current&amp;nbsp; month, is class is 'Legal' &lt;/P&gt;&lt;P&gt;- then sum(total_limit)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have compiled a code, but for some reason I dont think I'm getting it right...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please assist:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Temp]:&lt;/P&gt;&lt;P&gt;LOAD class,&lt;/P&gt;&lt;P&gt;&amp;nbsp; card_account_status_code,&lt;/P&gt;&lt;P&gt;&amp;nbsp; prev_card_account_status,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(MakeDate(left(info_date,4),mid(info_date,5,2),01), 'YYYY/MM/DD') as [Date],&lt;/P&gt;&lt;P&gt;&amp;nbsp; product,&lt;/P&gt;&lt;P&gt;&amp;nbsp; total,&lt;/P&gt;&lt;P&gt;&amp;nbsp; id_acc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From&lt;/P&gt;&lt;P&gt;C:....\Port\Port_*.qvd&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[CurrPrevMonth]:&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(((id_acc = previous(id_acc)) and date(date) &amp;lt;&amp;gt; date(monthstart(date-1) and class = 'Legal'),1,0) as [CurrFlag],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(((id_acc = previous(id_acc)) and date(date) &amp;lt;&amp;gt; date(monthstart(date-1) and previous(class) &amp;lt;&amp;gt; 'Legal' and upper(left(previous(card_account_status_code),1)&amp;lt;&amp;gt;'C'),1,0) as [PrevFlag]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resident Temp&lt;/P&gt;&lt;P&gt;Order by id_acc, Date asc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then on the front end i did the following:&lt;/P&gt;&lt;P&gt;sum(total)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 18:42:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940842#M324482</guid>
      <dc:creator />
      <dc:date>2015-12-02T18:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Previous and Current month data comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940843#M324483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share the data behind this script so that we can test it out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 18:57:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940843#M324483</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-12-02T18:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Previous and Current month data comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940844#M324484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Temp]:&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD class,&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&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="color: #0000ff;"&gt; Date(MakeDate(left(info_date,4),mid(info_date,5,2),01), 'YYYY/MM/DD') as &lt;STRONG&gt;[Date],&lt;/STRONG&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;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[CurrPrevMonth]:&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD *&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; if(((id_acc = previous(id_acc)) and date(&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;date&lt;/STRONG&gt;&lt;/SPAN&gt;) &amp;lt;&amp;gt; &lt;EM&gt;date(monthstart(&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;date&lt;/STRONG&gt;&lt;/SPAN&gt;-1)&lt;/EM&gt; and class = 'Legal'),1,0) as [CurrFlag],&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;...&lt;/P&gt;

&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Qlikview fields are case sensitive. So &lt;STRONG&gt;Date&lt;/STRONG&gt; and &lt;STRONG&gt;date&lt;/STRONG&gt; are two different fields to Qlikview.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&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="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;EM&gt;date(monthstart(&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;EM&gt;&lt;STRONG&gt;date&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;EM&gt;-1) &amp;lt;- &lt;/EM&gt;is missing a closing parenthesis.&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;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;date(monthstart(date-1)) returns the last day of the previous month. Is that what you need? Or do you need the first day of the previous month? That is returned by &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date(monthstart(date,-1)).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 06:19:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940844#M324484</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-12-03T06:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Previous and Current month data comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940845#M324485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the late reply, I want the last day of the previous month&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Dec 2015 06:23:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940845#M324485</guid>
      <dc:creator />
      <dc:date>2015-12-04T06:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Previous and Current month data comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940846#M324486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data behind is huge about 2G and I cant transfer it to the site&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Dec 2015 06:29:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940846#M324486</guid>
      <dc:creator />
      <dc:date>2015-12-04T06:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Previous and Current month data comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940847#M324487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if vMaxDate is having the current date, then you can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MakeDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vMaxDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vMaxDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;)))-1,'YYYY/MM/DD') &lt;/SPAN&gt; will give last date of previous month&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MakeDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vMaxDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vMaxDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;))+1)-1,'YYYY/MM/DD') &lt;/SPAN&gt; will give last date of current month&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Dec 2015 17:03:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-and-Current-month-data-comparison/m-p/940847#M324487</guid>
      <dc:creator />
      <dc:date>2015-12-04T17:03:18Z</dc:date>
    </item>
  </channel>
</rss>

