<?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: Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523437#M601075</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;Month perspective:&lt;/P&gt;&lt;P&gt;when using the formulas posted previously, they calculates for example YTD 2017&amp;nbsp; (i.e. Previous YTD)&amp;nbsp; taking into account the whole December. I would like to be able to compare the same period,&amp;nbsp; for example:&lt;/P&gt;&lt;P&gt;YTD (20180101 &amp;amp; 20181221)&lt;/P&gt;&lt;P&gt;Previous YTD (&lt;SPAN&gt;20170101 &amp;amp; 20171221)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Instead of that the formula calculates for the Previous Year:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Previous YTD (20170101 &amp;amp; 20171231)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And it is because of this part: Date(addyears(Max(DateKey),-1), 'YYYYMMDD')&amp;nbsp;which brings 20171231...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried to replace it by&amp;nbsp;date(addyears(date(today(),'YYYYMMDD'),-1),'YYYYMMDD'),&amp;nbsp; however it did not work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Dec 2018 12:34:23 GMT</pubDate>
    <dc:creator>Zaga_69</dc:creator>
    <dc:date>2018-12-21T12:34:23Z</dc:date>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523401#M601068</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;I’m using the following formula to calculate YTD and Previous YTD:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;YTD&lt;/P&gt;&lt;P&gt;Sum({1 &amp;lt;DateKey={"$(='&amp;gt;=' &amp;amp; Date(YearStart(Max(DateKey)), 'YYYYMMDD') &amp;amp; '&amp;lt;=' &amp;amp; Date(Today(),'YYYYMMDD')"}&amp;gt;} [Product_Sales])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previous YTD&lt;/P&gt;&lt;P&gt;Sum({1 &amp;lt;DateKey={"$(='&amp;gt;=' &amp;amp; Date(YearStart(Max(DateKey)), 'YYYYMMDD') &amp;amp; '&amp;lt;=' &amp;amp; Date(Today(),'YYYYMMDD')"}&amp;gt;} [Product_Sales])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formulas above work, however it calculates the YTD and Previous YTD from a month perspective. I would like for example to calculate YTD from a day perspective (i.e. sales between 20180101 &amp;amp; 20181221)&lt;/P&gt;&lt;P&gt;I tried to replace the second part of the formula using:&lt;/P&gt;&lt;P&gt;date(today(),'YYYYMMDD')&lt;/P&gt;&lt;P&gt;however, it did not work.&lt;/P&gt;&lt;P&gt;YTD&lt;/P&gt;&lt;P&gt;Sum({1 &amp;lt;DateKey={"$(='&amp;gt;=' &amp;amp; Date(YearStart(Max(DateKey)), 'YYYYMMDD') &amp;amp; '&amp;lt;=' &amp;amp; Date(Today(),'YYYYMMDD')"}&amp;gt;} [Product_Sales])&lt;/P&gt;&lt;P&gt;Finally DateKey was created as follows:&lt;/P&gt;&lt;P&gt;date(Date#("0PSTNG_DATE",'YYYYMMDD'),'YYYYMMDD') AS DateKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea will be much appreciated.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Edi&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:54:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523401#M601068</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2024-11-16T04:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523406#M601069</link>
      <description>If there is no concern from date field. You can try&lt;BR /&gt;Sum({1 &amp;lt;DateKey={"&amp;gt;=$(=Date(YearStart(Max(DateKey)), 'YYYYMMDD')&amp;lt;=$(=Date(Today(),'YYYYMMDD'))"}&amp;gt;} [Product_Sales])</description>
      <pubDate>Fri, 21 Dec 2018 11:12:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523406#M601069</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-12-21T11:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523412#M601070</link>
      <description>&lt;P&gt;Thanks, but unfortunately it did not work &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 11:42:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523412#M601070</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2018-12-21T11:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523413#M601071</link>
      <description>Can you please share sample data set or application. Can you check this in text object and tell us what it returns&lt;BR /&gt;Date(YearStart(Max(DateKey)), 'YYYYMMDD')</description>
      <pubDate>Fri, 21 Dec 2018 11:50:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523413#M601071</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-12-21T11:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523427#M601072</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/55910"&gt;@Zaga_69&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;The formulas above work, however it calculates the YTD and Previous YTD from a month perspective. I would like for example to calculate YTD from a day perspective (i.e. sales between 20180101 &amp;amp; 20181221)&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Can you elaborate on this? What do you mean when you say that the YTD and Previous YTD from a month perspective? Can you explain this with an example?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 12:17:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523427#M601072</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-21T12:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523433#M601073</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;This formula&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Date(YearStart(Max(DateKey)), 'YYYYMMDD')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;brings the following result:&lt;/P&gt;&lt;P&gt;20180101&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;</description>
      <pubDate>Fri, 21 Dec 2018 12:26:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523433#M601073</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2018-12-21T12:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523436#M601074</link>
      <description>Try this, make sure you are not looking the result after selection because you are ignoring all selections here. Check validation of expression as well&lt;BR /&gt;&lt;BR /&gt;Sum({1 &amp;lt;DateKey={"&amp;gt;=$(=Date(YearStart(Max(DateKey)), 'YYYYMMDD')&amp;lt;=$(=Date(Max(DateKey),'YYYYMMDD'))"}&amp;gt;} [Product_Sales])</description>
      <pubDate>Fri, 21 Dec 2018 12:30:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523436#M601074</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-12-21T12:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523437#M601075</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;Month perspective:&lt;/P&gt;&lt;P&gt;when using the formulas posted previously, they calculates for example YTD 2017&amp;nbsp; (i.e. Previous YTD)&amp;nbsp; taking into account the whole December. I would like to be able to compare the same period,&amp;nbsp; for example:&lt;/P&gt;&lt;P&gt;YTD (20180101 &amp;amp; 20181221)&lt;/P&gt;&lt;P&gt;Previous YTD (&lt;SPAN&gt;20170101 &amp;amp; 20171221)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Instead of that the formula calculates for the Previous Year:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Previous YTD (20170101 &amp;amp; 20171231)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And it is because of this part: Date(addyears(Max(DateKey),-1), 'YYYYMMDD')&amp;nbsp;which brings 20171231...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried to replace it by&amp;nbsp;date(addyears(date(today(),'YYYYMMDD'),-1),'YYYYMMDD'),&amp;nbsp; however it did not work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 12:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523437#M601075</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2018-12-21T12:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523439#M601076</link>
      <description>&lt;P&gt;So when you use this in a text box object...&lt;/P&gt;&lt;PRE&gt;=date(addyears(date(today(),'YYYYMMDD'),-1),'YYYYMMDD')&lt;/PRE&gt;&lt;P&gt;you don't see this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 648px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2537iEF2AC09F428842DB/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can you show us the screenshot of what you see when you use the above in a text box object?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 12:40:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523439#M601076</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-21T12:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523445#M601077</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It brings the right date:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dateexample.PNG" style="width: 632px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2539iD1CDF0094B41AA76/image-size/large?v=v2&amp;amp;px=999" role="button" title="dateexample.PNG" alt="dateexample.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 12:47:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523445#M601077</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2018-12-21T12:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523450#M601078</link>
      <description>&lt;P&gt;back to my original question, I would like to replace red part of this formula:&lt;/P&gt;&lt;P&gt;=Sum({1 &amp;lt;&lt;SPAN&gt;DateKey&lt;/SPAN&gt;={"$(='&amp;gt;=' &amp;amp; Date(YearStart(Max(DateKey)), 'YYYYMMDD') &amp;amp; '&amp;lt;=' &amp;amp; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Date((Max(&lt;SPAN&gt;DateKey&lt;/SPAN&gt;)), 'YYYYMMDD'))&lt;/STRONG&gt;&lt;/FONT&gt;"}&amp;gt;} [Product_Sales])&lt;/P&gt;&lt;P&gt;by this one:&lt;/P&gt;&lt;P&gt;date(addyears(date(today(),'YYYYMMDD'),-1),'YYYYMMDD')&lt;/P&gt;&lt;P&gt;However when replacing it does not work....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 12:56:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523450#M601078</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2018-12-21T12:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523451#M601079</link>
      <description>&lt;P&gt;So, that works, but you think that this doesn't?&lt;/P&gt;&lt;PRE&gt;Sum({1&amp;lt;DateKey = {"$(='&amp;gt;=' &amp;amp; Date(YearStart(Max(DateKey), -1), 'YYYYMMDD') &amp;amp; '&amp;lt;=' &amp;amp; Date(AddYears(Today(), -1), 'YYYYMMDD'))"}&amp;gt;} [Product_Sales])&lt;/PRE&gt;&lt;P&gt;Can you try the above expression in a chart where you have DateKey as a dimension and share a screenshot&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 12:56:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523451#M601079</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-21T12:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523453#M601080</link>
      <description>Try this expression and I would like you to share a screenshot where I can see 20181222, 20181223, 20181224, etc in a chart where you use the expression with DateKey as dimension&lt;BR /&gt;&lt;BR /&gt;Sum({1&amp;lt;DateKey = {"$(='&amp;gt;=' &amp;amp; Date(YearStart(Max(DateKey), -1), 'YYYYMMDD') &amp;amp; '&amp;lt;=' &amp;amp; Date(AddYears(Today(), -1), 'YYYYMMDD'))"}&amp;gt;} [Product_Sales])</description>
      <pubDate>Fri, 21 Dec 2018 12:57:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523453#M601080</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-21T12:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523460#M601081</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It works!&lt;/P&gt;&lt;P&gt;Thanks, I really appreciate your effort and help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dateexample.PNG" style="width: 888px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2540i21556DBB780F7FC0/image-size/large?v=v2&amp;amp;px=999" role="button" title="dateexample.PNG" alt="dateexample.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 13:07:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523460#M601081</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2018-12-21T13:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523463#M601082</link>
      <description>So, all good then?</description>
      <pubDate>Fri, 21 Dec 2018 13:09:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1523463#M601082</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-21T13:09:27Z</dc:date>
    </item>
  </channel>
</rss>

