<?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 help with working out what to include for QTR in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-help-with-working-out-what-to-include-for-QTR/m-p/121619#M753330</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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That looks good in my sample, i will apply it to my real data and test &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you explain how the RangeMin works please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Oct 2018 21:58:48 GMT</pubDate>
    <dc:creator>hopkinsc</dc:creator>
    <dc:date>2018-10-19T21:58:48Z</dc:date>
    <item>
      <title>Set Analysis help with working out what to include for QTR</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-help-with-working-out-what-to-include-for-QTR/m-p/121617#M753328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need some help with some complicated set analysis (or i think its complicated anyway!)&lt;/P&gt;&lt;P&gt;basically, i have an expression for Sales. it includes Actual and Forecast&lt;/P&gt;&lt;P&gt;one of my time selections is QTR, and its this thats giving me a headache.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following variables..&lt;/P&gt;&lt;P&gt;vCurrentPeriod - Holds the current period&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;vPV1_Period - this holds current period +1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vPV2_Period&lt;SPAN style="font-size: 13.3333px;"&gt; - this holds current period +2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;vPV3_Period&lt;SPAN style="font-size: 13.3333px;"&gt; - this holds current period +3&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vQtrStart - Holds the start period number of the current Qtr&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;vQtrEnd - Hold the end period of the current Qtr&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;These are the lines of my expression..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;This gives the sum of sales for actuals where the period is &amp;lt;=CurrentPeriod and &amp;gt;=QtrStart&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;DataSet={'Actuals'},Period={"&amp;lt;=$(=vCurrentPeriod)&amp;gt;=$(=vQtrStart)"}&amp;gt;}Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This gives the sum of PV1 where the period is &amp;gt;CurrentPeriod and less than the vPV1_Period variable&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;sum({&amp;lt;DataSet={'Forecast'},Period={"&amp;gt;$(=vCurrentPeriod)&amp;lt;=$(=vPV1_Period)"}&amp;gt;}PV1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;This gives the sum of PV2 where the period is &amp;gt;CurrentPeriod and less than the vPV2_Period variable&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;DataSet={'Forecast'},Period={"&amp;gt;$(=vCurrentPeriod)&amp;lt;=$(=vPV2_Period)"}&amp;gt;}PV2)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;This gives the sum of PV3 where the period is &amp;gt;CurrentPeriod and less than the vPV3_Period variable&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sum({&amp;lt;DataSet={'Forecast'},Period={"&amp;gt;$(=vCurrentPeriod)&amp;lt;=$(=vPV3_Period)"}&amp;gt;}PV3)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So the above lines of code are needed foe my expression, but for vertain periods i don't need all of the above. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;If the current period is 01, then my expression needs to be..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sum({&amp;lt;DataSet={'Actuals'},Period={"&amp;lt;=$(=vCurrentPeriod)&amp;gt;=$(=vQtrStart)"}&amp;gt;}Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;+&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;(sum({&amp;lt;DataSet={'Forecast'},Period={"&amp;gt;$(=vCurrentPeriod)&amp;lt;=$(=vPV1_Period)"}&amp;gt;}PV1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;+&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sum({&amp;lt;DataSet={'Forecast'},Period={"&amp;gt;$(=vCurrentPeriod)&amp;lt;=$(=vPV2_Period)"}&amp;gt;}PV2))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;so the above broken down is..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sales for Period 01 + PV1 (which is Period 02) + PV2 (which is Period 03)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I dont need the last line as this would include data for period 04 but that will mean it will go out of the current QTR number of 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;if the current period is 04, (meaning the current qtr is QTR 2 and consists of Periods 04-07) then the expression needs to be&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sum({&amp;lt;DataSet={'Actuals'},Period={"&amp;lt;=$(=vCurrentPeriod)&amp;gt;=$(=vQtrStart)"}&amp;gt;}Value) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;+&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;(sum({&amp;lt;DataSet={'Forecast'},Period={"&amp;gt;$(=vCurrentPeriod)&amp;lt;=$(=vPV1_Period)"}&amp;gt;}PV1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;+&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sum({&amp;lt;DataSet={'Forecast'},Period={"&amp;gt;$(=vCurrentPeriod)&amp;lt;=$(=vPV2_Period)"}&amp;gt;}PV2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;+&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sum({&amp;lt;DataSet={'Forecast'},Period={"&amp;gt;$(=vCurrentPeriod)&amp;lt;=$(=vPV3_Period)"}&amp;gt;}PV3))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;broken down it would be actual sales from periods 04 + PV1 (period 05) + PV2 (period 06) + PV3 (period 07)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I know i can do this using an IF statement but that will make the expression huge as all of the above is already in a nested if statement, so whatever the outcome of the above solution will be, it will need to be replicated 7 times within the same expression. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I was wondering if there was something i can do within the variable for the vQtrEnd (or another variable) to correctly determine which of the PV fields to include in the sum. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;any help or suggestions will be appreciated. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;see example attached. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks in advance. &lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-help-with-working-out-what-to-include-for-QTR/m-p/121617#M753328</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis help with working out what to include for QTR</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-help-with-working-out-what-to-include-for-QTR/m-p/121618#M753329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;DataSet={'Actuals'},Period={"&amp;lt;=$(=vCurrentPeriod)&amp;gt;=$(=vQtrStart)"}&amp;gt;}Value)&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;(sum({&amp;lt;DataSet={'Forecast'},Period={"=Period&amp;gt;$(=vCurrentPeriod) and Period&amp;lt;=$(=RangeMin(vPV1_Period,vQtrEnd))"}&amp;gt;}PV1)&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;sum({&amp;lt;DataSet={'Forecast'},Period={"=Period&amp;gt;$(=vCurrentPeriod) and Period&amp;lt;=$(=RangeMin(vPV2_Period,vQtrEnd))"}&amp;gt;}PV2)&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;sum({&amp;lt;DataSet={'Forecast'},Period={"=Period&amp;gt;$(=vCurrentPeriod) and Period&amp;lt;=$(=RangeMin(vPV3_Period,vQtrEnd))"}&amp;gt;}PV3))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2018 21:52:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-help-with-working-out-what-to-include-for-QTR/m-p/121618#M753329</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2018-10-19T21:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis help with working out what to include for QTR</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-help-with-working-out-what-to-include-for-QTR/m-p/121619#M753330</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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That looks good in my sample, i will apply it to my real data and test &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you explain how the RangeMin works please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2018 21:58:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-help-with-working-out-what-to-include-for-QTR/m-p/121619#M753330</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2018-10-19T21:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis help with working out what to include for QTR</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-help-with-working-out-what-to-include-for-QTR/m-p/121620#M753331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;its ok, ive looked in the help file &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2018 22:02:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-help-with-working-out-what-to-include-for-QTR/m-p/121620#M753331</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2018-10-19T22:02:24Z</dc:date>
    </item>
  </channel>
</rss>

