<?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: Cross table YTD values else zero in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Cross-table-YTD-values-else-zero/m-p/455357#M169948</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To summarise:&lt;/P&gt;&lt;P&gt;If a month is selected there is just one column shown, with the year to date amount.&lt;/P&gt;&lt;P&gt;If no month is selected then the months to date show the monthly amounts, and future months show 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two issues:&lt;/P&gt;&lt;P&gt;once a month is selected, you have to then 'break out of that selection' to show the year to date amount. For this set analysis is ideal.&lt;/P&gt;&lt;P&gt;what if more than one month is selected (i.e. a selection of month is made but not just one). Do you then show the year to date, choosing the maximum month. I'll assume you do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start with an if statement to test how many distinct months are selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(count(distinct Month)=count(ALL distinct Month),....,.....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If one or more months are selected, use a set analysis statement like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Month=,Date={'&amp;gt;=YearStart(max(fielddate)) &amp;lt;=MonthEnd(max(fielddate))'}&amp;gt;} fieldvalue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If no month is selected, use the same set analysis, but without ignoring the month, to show the months values up to the max date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Date={'&amp;gt;=YearStart(max(fielddate)) &amp;lt;=MonthEnd(max(fielddate))'}&amp;gt;} fieldvalue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can't get these statements working (I've not tested myself) try creating variables for the start and end dates, or post an example application.&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Feb 2013 10:10:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-02-21T10:10:21Z</dc:date>
    <item>
      <title>Cross table YTD values else zero</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-YTD-values-else-zero/m-p/455356#M169947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a crosstable to make, I have two dimensions, one that contains monthsYear . the months Year dimension must be on top and the other dimension on the left , what I need is if there is a selected month, we need to show values of the expressions from&amp;nbsp; the startof the year, till the selected month, else we show the remaining months of the year too but with zero instead of the value, for exemple if I select april if must show the values till april, however starting from may it must show zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2013 15:06:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-YTD-values-else-zero/m-p/455356#M169947</guid>
      <dc:creator />
      <dc:date>2013-02-20T15:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Cross table YTD values else zero</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-YTD-values-else-zero/m-p/455357#M169948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To summarise:&lt;/P&gt;&lt;P&gt;If a month is selected there is just one column shown, with the year to date amount.&lt;/P&gt;&lt;P&gt;If no month is selected then the months to date show the monthly amounts, and future months show 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two issues:&lt;/P&gt;&lt;P&gt;once a month is selected, you have to then 'break out of that selection' to show the year to date amount. For this set analysis is ideal.&lt;/P&gt;&lt;P&gt;what if more than one month is selected (i.e. a selection of month is made but not just one). Do you then show the year to date, choosing the maximum month. I'll assume you do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start with an if statement to test how many distinct months are selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(count(distinct Month)=count(ALL distinct Month),....,.....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If one or more months are selected, use a set analysis statement like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Month=,Date={'&amp;gt;=YearStart(max(fielddate)) &amp;lt;=MonthEnd(max(fielddate))'}&amp;gt;} fieldvalue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If no month is selected, use the same set analysis, but without ignoring the month, to show the months values up to the max date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Date={'&amp;gt;=YearStart(max(fielddate)) &amp;lt;=MonthEnd(max(fielddate))'}&amp;gt;} fieldvalue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can't get these statements working (I've not tested myself) try creating variables for the start and end dates, or post an example application.&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 10:10:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-YTD-values-else-zero/m-p/455357#M169948</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-21T10:10:21Z</dc:date>
    </item>
  </channel>
</rss>

