<?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 Want to use date function in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Want-to-use-date-function-in-set-analysis/m-p/366603#M493624</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm fairly new to Set Analysis and I'm hoping what I'm trying to do is fairly common and it's just my lack of expertise that is limiting me. I have a large data set that looks something like the below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As of Date, Amount&lt;/P&gt;&lt;P&gt;10/31/11, 934&lt;/P&gt;&lt;P&gt;11/30/11, 305&lt;/P&gt;&lt;P&gt;12/31/11, 468&lt;/P&gt;&lt;P&gt;1/31/12, 567&lt;/P&gt;&lt;P&gt;2/29/12, 949&lt;/P&gt;&lt;P&gt;3/31/12, 945&lt;/P&gt;&lt;P&gt;4/30/12, 349&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In reality, my data set is about 50 million rows and 130 columns but the the above illustrates what I'm trying to accomplish. What I'd like to do is figure out the correct set analysis to get the YTD sum of Amount. I know the below syntax is not correct (I'm still learning this) but I'd like to do something along the lines of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum( {$&amp;lt;year[As of Date] = {'$(#vCurrentYear)'}&amp;gt;} Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where vCurrentYear is a variables that =year(today()). I've been able to find on these community pages the method for doing the second part of the equation but I can't find anything that would tell me if/how I can use a date function to get the year of an [As of Date] (which is a Qlikview date). Does anyone know? If this is not possible, is there an alternative way of doing this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2012 04:17:34 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-24T04:17:34Z</dc:date>
    <item>
      <title>Want to use date function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Want-to-use-date-function-in-set-analysis/m-p/366603#M493624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm fairly new to Set Analysis and I'm hoping what I'm trying to do is fairly common and it's just my lack of expertise that is limiting me. I have a large data set that looks something like the below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As of Date, Amount&lt;/P&gt;&lt;P&gt;10/31/11, 934&lt;/P&gt;&lt;P&gt;11/30/11, 305&lt;/P&gt;&lt;P&gt;12/31/11, 468&lt;/P&gt;&lt;P&gt;1/31/12, 567&lt;/P&gt;&lt;P&gt;2/29/12, 949&lt;/P&gt;&lt;P&gt;3/31/12, 945&lt;/P&gt;&lt;P&gt;4/30/12, 349&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In reality, my data set is about 50 million rows and 130 columns but the the above illustrates what I'm trying to accomplish. What I'd like to do is figure out the correct set analysis to get the YTD sum of Amount. I know the below syntax is not correct (I'm still learning this) but I'd like to do something along the lines of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum( {$&amp;lt;year[As of Date] = {'$(#vCurrentYear)'}&amp;gt;} Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where vCurrentYear is a variables that =year(today()). I've been able to find on these community pages the method for doing the second part of the equation but I can't find anything that would tell me if/how I can use a date function to get the year of an [As of Date] (which is a Qlikview date). Does anyone know? If this is not possible, is there an alternative way of doing this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 04:17:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Want-to-use-date-function-in-set-analysis/m-p/366603#M493624</guid>
      <dc:creator />
      <dc:date>2012-05-24T04:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Want to use date function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Want-to-use-date-function-in-set-analysis/m-p/366604#M493625</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;I think you have to extract the year part of your dimension in the script. Use something like Year([As of Date]) AS [As of Date Year]. And then you can replace &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;year[As of Date]&lt;/SPAN&gt; with [As of Date Year].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Teemu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 05:10:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Want-to-use-date-function-in-set-analysis/m-p/366604#M493625</guid>
      <dc:creator>teempi</dc:creator>
      <dc:date>2012-05-24T05:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Want to use date function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Want-to-use-date-function-in-set-analysis/m-p/366605#M493626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/honeycomb" id="jive-4691726270218251207021"&gt;honeycomb&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I would recommend to add a year field in your data model. which you can do using Year() function on your date field as &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/teempi" id="jive-800026270218258173021"&gt;teempi&lt;/A&gt; also suggested. Which will provide you more flexibility and year field will be used quite frequently as a filter when users to analysis on the data, which will allow them to select years and see data for that year only.&lt;/P&gt;&lt;P&gt;Generally, A calendar is loaded in Qlikview data model which contains Day, Week, Month, Monthname, Quarter, Year etc, which comes very handy to show trend lines, as well as drill downs and other analysis as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also,It is possible to achieve what you want to achieve in front -end using set analysis also. In Set analysis you can not pass values on a calculated dimension. So, for this you need to do it like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;=sum( {$&amp;lt; [As of Date] = {"= Year([As of Date])&amp;nbsp; =&amp;nbsp; $(#vCurrentYear)"}&amp;gt;} Amount)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should do the trick. Let me know, if any issue! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;Ashutosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 05:50:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Want-to-use-date-function-in-set-analysis/m-p/366605#M493626</guid>
      <dc:creator />
      <dc:date>2012-05-24T05:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Want to use date function in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Want-to-use-date-function-in-set-analysis/m-p/366606#M493627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Honey ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create the Master calender using your date field i.e.[As of Date]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then use the &lt;STRONG&gt;year&lt;/STRONG&gt; field for the set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or attach the sample data with qvw file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nilesh Gangurde&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 05:57:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Want-to-use-date-function-in-set-analysis/m-p/366606#M493627</guid>
      <dc:creator>nilesh_gangurde</dc:creator>
      <dc:date>2012-05-24T05:57:55Z</dc:date>
    </item>
  </channel>
</rss>

