<?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: If condition in Qlik Automate</title>
    <link>https://community.qlik.com/t5/Qlik-Automate/If-condition/m-p/2030162#M1280</link>
    <description>&lt;P&gt;I would suggest you do date compare rather than text compare, you can get previous month from today's date like this -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date(MonthEnd( Today(1)&amp;nbsp;&lt;SPAN&gt;,-1),'YYYYMM')&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;So compare your data model date field as -&lt;/P&gt;
&lt;P&gt;if (Monthend(Datefield)=Date(MonthEnd( Today(1)&amp;nbsp;&lt;SPAN&gt;,-1),'YYYYMM')&lt;/SPAN&gt;&lt;SPAN&gt;,true,false)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2023 02:23:33 GMT</pubDate>
    <dc:creator>Digvijay_Singh</dc:creator>
    <dc:date>2023-01-26T02:23:33Z</dc:date>
    <item>
      <title>If condition</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/If-condition/m-p/2030127#M1279</link>
      <description>&lt;P&gt;Hello Friends,&lt;/P&gt;
&lt;P&gt;Need to write this if statement in script but it errored out saying nested aggregation is not allowed&amp;nbsp;&lt;/P&gt;
&lt;P&gt;all I need is the previous month's Year month YYYYMM in this case in 202212, Please let me know if I can write this anyother way&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if(AccYearMonth&amp;gt;(year(AddYears(max(now()),-1) &amp;amp; (num(MONTH (AddMonths (MAX (now()), - 1))))))&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;using above statement hear&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;sum(if(AccYearMonth&amp;gt;(year(AddYears(max(now()),-1) &amp;amp; (num(MONTH (AddMonths (MAX (now()), - 1)))))) and AccYearMonth&amp;lt;$(vNextMonthYYYYMM), Quantity*PRICE)) as abcd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 22:16:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/If-condition/m-p/2030127#M1279</guid>
      <dc:creator>danny4202001</dc:creator>
      <dc:date>2023-01-25T22:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: If condition</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/If-condition/m-p/2030162#M1280</link>
      <description>&lt;P&gt;I would suggest you do date compare rather than text compare, you can get previous month from today's date like this -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date(MonthEnd( Today(1)&amp;nbsp;&lt;SPAN&gt;,-1),'YYYYMM')&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;So compare your data model date field as -&lt;/P&gt;
&lt;P&gt;if (Monthend(Datefield)=Date(MonthEnd( Today(1)&amp;nbsp;&lt;SPAN&gt;,-1),'YYYYMM')&lt;/SPAN&gt;&lt;SPAN&gt;,true,false)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 02:23:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/If-condition/m-p/2030162#M1280</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2023-01-26T02:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: If condition</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/If-condition/m-p/2030490#M1283</link>
      <description>&lt;P&gt;Hello Digvijay thank you for your reply&lt;/P&gt;
&lt;P&gt;The below query is giving perfect results as a set analysis but when I write this in script its gives wrong results data before May&amp;nbsp;&lt;/P&gt;
&lt;P&gt;vNextmonth1= May&lt;/P&gt;
&lt;P&gt;sum({$&amp;lt;AccYearPeriod={"&amp;gt;=$(vNextmonth1)"} Quantity_OO *UNIT_SELLING_PRICE_OO)--- results are perfect&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sum(if(AccYearMonth&amp;gt;=($(vNextmonth1)), Quantity_OO * UNIT_SELLING_PRICE_OO)),'0' as FMTHGT3Open----------------------results are not right data includes from may and before&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 16:58:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/If-condition/m-p/2030490#M1283</guid>
      <dc:creator>danny4202001</dc:creator>
      <dc:date>2023-01-26T16:58:40Z</dc:date>
    </item>
  </channel>
</rss>

