<?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: exclude items variably based on actual date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897482#M469419</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not entirely sure what you are trying to do here. Regardless of which part of the if statement you are, you seem to be having the same expression (assuming &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;{$(&amp;lt;(vDate&lt;SPAN style="color: #ff0000;"&gt;-?&lt;/SPAN&gt;))}&lt;/STRONG&gt; to be a typo). Would you be able to provide with a sample qvw document or at least some sample data with expected output?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jul 2015 12:13:02 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2015-07-07T12:13:02Z</dc:date>
    <item>
      <title>exclude items variably based on actual date</title>
      <link>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897479#M469416</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 have a problem with chart expression (chart shows margin progress during last three years) - i want to create a chart which shows all data until the date as follows:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt; &lt;STRONG&gt;IF(Day(Today())&amp;lt;15&lt;/STRONG&gt;, show values until &lt;STRONG&gt;Month(Today())-1&lt;/STRONG&gt;, (e.g. if today is 7.7.2015 exclude data booked after 31.5.2015)&lt;/LI&gt;&lt;LI&gt; &lt;STRONG&gt;IF(Day(Today())&amp;gt;15&lt;/STRONG&gt;, show values until &lt;STRONG&gt;Month(Today())&lt;/STRONG&gt;, (e.g. if today is 7.7.2015 exclude data booked after 30.6.2015);&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't do it by excluding month - it works but the QV excludes this month in every year. So I've created a variable &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; =monthstart(Today())&lt;/STRONG&gt; hoping this excludes all data booked after 1st day of current month&lt;/P&gt;&lt;P&gt;but it is not working - maybe because of the date format? I adjusted the format like D.M.YYYY in script so it fits the format of variable result but still no progress. And how to use the variable in case I need to exclude also data book after 31.5.2015? Using (-1) do not give the right result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Lucie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 10:14:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897479#M469416</guid>
      <dc:creator />
      <dc:date>2015-07-07T10:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: exclude items variably based on actual date</title>
      <link>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897480#M469417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this may be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=Date(MonthStart(Today()), 'D.M.YYYY')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 10:19:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897480#M469417</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-07-07T10:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: exclude items variably based on actual date</title>
      <link>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897481#M469418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;But this change the date format only but I need it to works in expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(Day(Today())&amp;lt;15,sum({&amp;lt;Date={$(&amp;lt;(vDate-?))},Amount),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Day(Today())&amp;gt;=15,sum({&amp;lt;Date={$(&amp;lt;(vDate))},Amount)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where vDate represents the maximum date QV should include to amount calculation and which is not working. Any other ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 12:08:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897481#M469418</guid>
      <dc:creator />
      <dc:date>2015-07-07T12:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: exclude items variably based on actual date</title>
      <link>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897482#M469419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not entirely sure what you are trying to do here. Regardless of which part of the if statement you are, you seem to be having the same expression (assuming &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;{$(&amp;lt;(vDate&lt;SPAN style="color: #ff0000;"&gt;-?&lt;/SPAN&gt;))}&lt;/STRONG&gt; to be a typo). Would you be able to provide with a sample qvw document or at least some sample data with expected output?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 12:13:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897482#M469419</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-07-07T12:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: exclude items variably based on actual date</title>
      <link>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897483#M469420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to use something like &lt;STRONG&gt;vDate&lt;/STRONG&gt; if &lt;STRONG&gt;(Day(Today())&amp;gt;15 &lt;/STRONG&gt;(I want to sum only data before the first day of current month) and vDate-?(something like 1? not sure) if &lt;STRONG&gt;(Day(Today())&amp;lt;15&lt;/STRONG&gt; (I want to sum only data before the first day of previous month - as you can see above).&lt;/P&gt;&lt;P&gt;If I understand you correctly by changing the date format in variable I can influence the field value in expression?&lt;/P&gt;&lt;P&gt;So if my date format is DD.MM.YYYY and I'll change it in variable to MM-DD-YYYY then the QV won't be able to select all items after e.g. 11-13-2015 because the date in "Date" field looks like 13.11.2015?&lt;/P&gt;&lt;P&gt;Unfortunatelly I cant provide you by sample of qvw document...&lt;/P&gt;&lt;P&gt;Thanks, L.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 13:25:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897483#M469420</guid>
      <dc:creator />
      <dc:date>2015-07-07T13:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: exclude items variably based on actual date</title>
      <link>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897484#M469421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes for set analysis to work on dates the Left Hand Side (LHS) and Right Hand Side (RHS) need to have same date format. Its annoying sometimes but that's the way it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So to make them same format, I would do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Sum({&amp;lt;Date={"$(='&amp;lt;' &amp;amp; Date($(vDate), 'DD.MM.YYYY'))"},Amount)))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where Date is in the format DD.MM.YYYY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 13:30:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897484#M469421</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-07-07T13:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: exclude items variably based on actual date</title>
      <link>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897485#M469422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved it that way:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=if(Day(Today())&amp;lt;15,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(sum({&amp;lt;Month=,Year=,Data.Date={'&amp;lt;$(vPriorMonthStart)'}&lt;/EM&gt;, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vPriorMonthStart=day(MonthStart(Today()))&amp;amp;'.'&amp;amp;(month(MonthStart(Today()))-1)&amp;amp;'.'&amp;amp;vCurrentYear&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(Day(Today())&amp;gt;=15,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(sum({&amp;lt;Month=,Year=,Data.Date={'&amp;lt;$(vCurrentMonthStart)'},&lt;/EM&gt; etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vCurrentMonthStart=day(MonthStart(Today()))&amp;amp;'.'&amp;amp;num(month(MonthStart(Today())),'0')&amp;amp;'.'&amp;amp;vCurrentYear&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Nothing else worked.&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Thank you for help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 11:06:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897485#M469422</guid>
      <dc:creator />
      <dc:date>2015-07-20T11:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: exclude items variably based on actual date</title>
      <link>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897486#M469423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome &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;I am glad you were able to figure it out. I would suggest closing the thread by marking your answer as 'Correct Answer', instead of 'Helpful Answer'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 13:34:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/exclude-items-variably-based-on-actual-date/m-p/897486#M469423</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-07-20T13:34:01Z</dc:date>
    </item>
  </channel>
</rss>

