<?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 Set Analysis  - Dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269119#M1191421</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Accrding to me Variable should be assigned as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 8pt;"&gt;varPreYearFullDateEnd=&amp;nbsp; assign it : =makedate('2010','12','31')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jul 2011 09:10:50 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-07-11T09:10:50Z</dc:date>
    <item>
      <title>Set Analysis  - Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269114#M1191416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have the below expression. This expression returns me zero. Not sure where I am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count({&amp;lt;[link_claim_Claim_Status]={"*"} - {"CLO"},[Start Date] ={"&amp;lt;=addmonths($(varPreYearFullDateEnd),1)"}&amp;gt;} DISTINCT [ClaimID])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(varPreYearFullDateEnd) has been assigned =Date('31/12/2010','DD/MM/YYYY'). I want to do the calculation for 31/01/2011 by adding 1 month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count({&amp;lt;[link_claim_Claim_Status]={"*"} - {"CLO"},[Start Date] ={"&amp;lt;=$(varPreYearFullDateEnd)"}&amp;gt;} DISTINCT [ClaimID]) just works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;returns me the correct value. I just want to add 1 month. I tried many ways where I will have date in the number format, use sum etc..finally asking the community to help.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Rajesh Vaswani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 08:41:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269114#M1191416</guid>
      <dc:creator>rajeshvaswani77</dc:creator>
      <dc:date>2011-07-09T08:41:23Z</dc:date>
    </item>
    <item>
      <title>Set Analysis  - Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269115#M1191417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajesh Vaswani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need a dollar sign expansion also for the addmonths function to call it within the set expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; =Count({&amp;lt;[link_claim_Claim_Status]={"*"} - {"CLO"},[Start Date] ={"&amp;lt;=$(=addmonths($(varPreYearFullDateEnd),1))"}&amp;gt;} DISTINCT [ClaimID])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 09:51:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269115#M1191417</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-09T09:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis  - Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269116#M1191418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;Hi Rajesh,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;Stefan is right and using dollar sign expansion should do the trick. Although with these kind of requirement I generally prefer to load the master calendar table in the load script. I had attached an example of master calendar for your reference. If you look into the master calendar you will see I have MTD, WTD, YTD &amp;amp; previousYear etc. Also, if I am re-using same expressions within other objects then I would declare my expression as variables and use the dollar sign expansion. This approach helps me to maintin the calculations in one centralised location (Variable Overiew Window). And the re-usability &amp;amp; maintainence of these expression is easy. This is just like adding an abstraction layer.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;I hope this helps!&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;Cheers - DV&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 10:04:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269116#M1191418</guid>
      <dc:creator>IAMDV</dc:creator>
      <dc:date>2011-07-09T10:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis  - Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269117#M1191419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thankyou for your reply. After $ expansion too it does not work. I am trying to figure out why. Let me know if you could suggest anything?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rajesh Vaswani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Jul 2011 12:44:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269117#M1191419</guid>
      <dc:creator>rajeshvaswani77</dc:creator>
      <dc:date>2011-07-10T12:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis  - Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269118#M1191420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following expression seems to work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count({&amp;lt;[link_claim_Claim_Status]={"*"}-{"CLO"},[StartDate]={"&amp;lt;=$(varPreYearFullDateEnd+1)"}&amp;gt;} DISTINCT [ClaimID])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 01:46:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269118#M1191420</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2011-07-11T01:46:56Z</dc:date>
    </item>
    <item>
      <title>Set Analysis  - Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269119#M1191421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Accrding to me Variable should be assigned as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 8pt;"&gt;varPreYearFullDateEnd=&amp;nbsp; assign it : =makedate('2010','12','31')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 09:10:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269119#M1191421</guid>
      <dc:creator />
      <dc:date>2011-07-11T09:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis  - Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269120#M1191422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajesh Vaswani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed two issues:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with variable definition like&lt;/P&gt;&lt;P&gt;=Date('31/12/2010','DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I needed to remove the $() around the variable name when using the variable as argument to AddMonths function, i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&amp;lt;StartDate=&amp;nbsp; {"&amp;lt;=$(=AddMonths(varPreYearFullDateEnd,1))"} &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I also struggle from time to time with variable evaluation).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is also important, that there is no space between the smaller than (&amp;lt;=) and the dollar sign of the dollar sign expansion (I get zero as result otherwise).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Erika wrote, I think a MakeDate would be clearer to understand what you want to achieve (assigning a date to a variable), so your expression should work as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my test app, it works quite well, if you have any more problems, it may be useful if you could post a small sample application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 09:10:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Dates/m-p/269120#M1191422</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-12T09:10:29Z</dc:date>
    </item>
  </channel>
</rss>

