<?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 Extract the data for Current Month and Previous Month by NPrinting filter in Qlik NPrinting</title>
    <link>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1888985#M34992</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I have created one tabular report in QlikSense which has Year, Month, Name, Measures.&lt;/P&gt;
&lt;P&gt;I want to extract the two months of data from the Qlik Nprinting Report and save it as an excel file.&lt;/P&gt;
&lt;P&gt;I need to filter two months of data, if I am in Jan 2022, the data should be stored Jan 2022 and Dec 2021 data in the file.&lt;/P&gt;
&lt;P&gt;I am using the Yearmonth field (YYYYMM).&lt;/P&gt;
&lt;P&gt;Kinldy provide the syntax for extraxting the two months data&lt;/P&gt;
&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt; &amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Feb 2022 07:58:03 GMT</pubDate>
    <dc:creator>dineshm030</dc:creator>
    <dc:date>2022-02-04T07:58:03Z</dc:date>
    <item>
      <title>Extract the data for Current Month and Previous Month by NPrinting filter</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1888985#M34992</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I have created one tabular report in QlikSense which has Year, Month, Name, Measures.&lt;/P&gt;
&lt;P&gt;I want to extract the two months of data from the Qlik Nprinting Report and save it as an excel file.&lt;/P&gt;
&lt;P&gt;I need to filter two months of data, if I am in Jan 2022, the data should be stored Jan 2022 and Dec 2021 data in the file.&lt;/P&gt;
&lt;P&gt;I am using the Yearmonth field (YYYYMM).&lt;/P&gt;
&lt;P&gt;Kinldy provide the syntax for extraxting the two months data&lt;/P&gt;
&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt; &amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 07:58:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1888985#M34992</guid>
      <dc:creator>dineshm030</dc:creator>
      <dc:date>2022-02-04T07:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extract the data for Current Month and Previous Month by NPrinting filter</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1888997#M34993</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/16771"&gt;@dineshm030&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide a syntax of how you create your YYYYMM field in Qlik script as it is critical to know whether it is created as: text, number, date/dual.&lt;/P&gt;
&lt;P&gt;The typical way of creating it would be similar to:&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Date(Floor(MonthStart(YourDate)),'YYYYMM')&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If the above is true you could simply use Evalueate filter like:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;MonthYear = Evaluate value = Num(Floor(MonthStart(Today()) - for current month&lt;/LI&gt;
&lt;LI&gt;MonthYear = Evaluate value = Num(Floor(MonthStart(Today(),-1) - for last month&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Or you could use advanced search as described in my post linked below&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;MonthYear =&lt;STRONG&gt;&lt;EM&gt;([MonthYear]&amp;gt;=MonthStart(Today(),-1))*([MonthYear]&amp;lt;=MonthStart(Today()))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I have explained importance of that&amp;nbsp; (of verifying what is the type of data we are trying to filter) in my post about typical mistakes when working with filters here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nprintingadventures.com/2019/02/15/the-pitfalls-of-nprinting-filters-part-1-dates-and-duals/" target="_blank"&gt;https://nprintingadventures.com/2019/02/15/the-pitfalls-of-nprinting-filters-part-1-dates-and-duals/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;you may find this usefull for your purpose:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nprintingadventures.com/2019/06/26/nprinting-filters-part-3-advanced-search/" target="_blank"&gt;https://nprintingadventures.com/2019/06/26/nprinting-filters-part-3-advanced-search/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-NPrinting-Discussions/Filter-Previous-month-Nprinintg/td-p/1798789" target="_blank"&gt;https://community.qlik.com/t5/Qlik-NPrinting-Discussions/Filter-Previous-month-Nprinintg/td-p/1798789&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and as always there is plenty of context on community covering exactly the same topic:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-NPrinting-Discussions/FILTER-CURRENT-MONTH/td-p/1804558" target="_blank"&gt;https://community.qlik.com/t5/Qlik-NPrinting-Discussions/FILTER-CURRENT-MONTH/td-p/1804558&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-NPrinting-Discussions/Filter-Previous-month-Nprinintg/td-p/1798789" target="_blank"&gt;https://community.qlik.com/t5/Qlik-NPrinting-Discussions/Filter-Previous-month-Nprinintg/td-p/1798789&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-NPrinting-Discussions/How-to-set-up-a-filter-quot-Last-X-days-quot-in-NPrinting/td-p/1203955" target="_blank"&gt;https://community.qlik.com/t5/Qlik-NPrinting-Discussions/How-to-set-up-a-filter-quot-Last-X-days-quot-in-NPrinting/td-p/1203955&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;at the end&lt;/P&gt;
&lt;P&gt;always start by studying qlik help site which covers all those questions:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/nprinting/May2021/Content/NPrinting/ReportsDevelopment/Static-dynamic-filters.htm" target="_blank"&gt;https://help.qlik.com/en-US/nprinting/May2021/Content/NPrinting/ReportsDevelopment/Static-dynamic-filters.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 05:58:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1888997#M34993</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2022-02-04T05:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extract the data for Current Month and Previous Month by NPrinting filter</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889051#M34995</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1326"&gt;@Lech_Miszkiewicz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am facing the issue below filters.&lt;/P&gt;
&lt;P&gt;I want to filter based on the Yearmonth column (YYYYMM). I need to extract two months data.&lt;/P&gt;
&lt;P&gt;Please do the needful.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dineshm030_0-1643963318453.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/71590i8B9AD9C8F21DB48B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dineshm030_0-1643963318453.png" alt="dineshm030_0-1643963318453.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 08:30:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889051#M34995</guid>
      <dc:creator>dineshm030</dc:creator>
      <dc:date>2022-02-04T08:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extract the data for Current Month and Previous Month by NPrinting filter</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889057#M34996</link>
      <description>&lt;P&gt;&lt;STRONG&gt;I repeat. How do you create your Yearmonth field in qlik sense script?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;we must know that to give you correct answer as we must know if it is date, dual, text or number&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 08:41:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889057#M34996</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2022-02-04T08:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Extract the data for Current Month and Previous Month by NPrinting filter</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889061#M34997</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1326"&gt;@Lech_Miszkiewicz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it's coming as a Number. When I put Max(Yearmonth) it returns as 202201.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dineshm030_0-1643964940958.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/71591i41A1B526E40D5AAC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dineshm030_0-1643964940958.png" alt="dineshm030_0-1643964940958.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 08:56:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889061#M34997</guid>
      <dc:creator>dineshm030</dc:creator>
      <dc:date>2022-02-04T08:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extract the data for Current Month and Previous Month by NPrinting filter</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889082#M34998</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1326"&gt;@Lech_Miszkiewicz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I filter with maximum yearmonth. I get maximum year month data in that report.&lt;/P&gt;
&lt;P&gt;how do we filter for two months?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dineshm030_0-1643966698273.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/71599i5175F406259539EA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dineshm030_0-1643966698273.png" alt="dineshm030_0-1643966698273.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 09:26:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889082#M34998</guid>
      <dc:creator>dineshm030</dc:creator>
      <dc:date>2022-02-04T09:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract the data for Current Month and Previous Month by NPrinting filter</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889087#M34999</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/16771"&gt;@dineshm030&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well that still can be a date with YYYYMM mask on it. That is the reason why I ask to provide the script loading that field....&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if you insist that it is a number then we have to work around it little bit as we have to translate:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;date to text&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;then text to number&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;So for example if your 202201 is actually a number value of &lt;EM&gt;two hundred twenty two thousand and one&lt;/EM&gt; and its type in Qlik Sense is numeric then you would have to do:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lech_Miszkiewicz_0-1643966672329.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/71598i8B221EF01E4019D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Lech_Miszkiewicz_0-1643966672329.png" alt="Lech_Miszkiewicz_0-1643966672329.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yearmonth&lt;/P&gt;
&lt;P&gt;Values:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Evaluate value = num#(Text(Date(Today(),'YYYYMM')))&lt;/LI&gt;
&lt;LI&gt;
&lt;P class="p1"&gt;Evaluate value = num#&lt;SPAN class="s1"&gt;(&lt;/SPAN&gt;Text&lt;SPAN class="s1"&gt;(&lt;/SPAN&gt;Date&lt;SPAN class="s1"&gt;(&lt;/SPAN&gt;AddMonths&lt;SPAN class="s1"&gt;(&lt;/SPAN&gt;Today&lt;SPAN class="s1"&gt;(),-1),'YYYYMM')))&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;This will only work if what you are saying is true and the yearmonth is not actual year month value but simply a number.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;Explanation:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Providing load script statement for that field/and or preview of the actual data type from Qlik Sense model viewer would clarify all doubts. As you can see from gif below all 3 fields look the same but all of them would have to have differently constructed filter because they are of different data type.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lech_Miszkiewicz_1-1643967430234.gif" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/71600i393334779BBA8436/image-size/large?v=v2&amp;amp;px=999" role="button" title="Lech_Miszkiewicz_1-1643967430234.gif" alt="Lech_Miszkiewicz_1-1643967430234.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 09:37:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889087#M34999</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2022-02-04T09:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Extract the data for Current Month and Previous Month by NPrinting filter</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889093#M35000</link>
      <description>&lt;P&gt;So just like on my screenshot you just create 2 values and if you are using Max() function then you could use:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Evaluate value = Max(Yearmonth)&lt;/LI&gt;
&lt;LI&gt;Evaluate value = Max(Yearmonth&lt;FONT color="#FF0000"&gt;,2)&lt;FONT color="#000000"&gt; (second parameter is a rank which will give you second max value)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 04 Feb 2022 09:53:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889093#M35000</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2022-02-04T09:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Extract the data for Current Month and Previous Month by NPrinting filter</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889198#M35001</link>
      <description>&lt;P&gt;It is working&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1326"&gt;@Lech_Miszkiewicz&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;Thank you so much for your assistance.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 13:16:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Extract-the-data-for-Current-Month-and-Previous-Month-by/m-p/1889198#M35001</guid>
      <dc:creator>dineshm030</dc:creator>
      <dc:date>2022-02-04T13:16:27Z</dc:date>
    </item>
  </channel>
</rss>

