<?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 help required in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-required/m-p/757259#M1049471</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 did noticed similar some similar topic &lt;A _jive_internal="true" href="https://community.qlik.com/thread/140623"&gt;here&lt;/A&gt; . But does not work for me.&lt;/P&gt;&lt;P&gt;I am trying to get from selected Year and Month generate a date and get count of &lt;STRONG&gt;all&lt;/STRONG&gt; rows (including unselected) based on calculated date. As this code will be reused many times I've placed into variable. I get values correctly when nothing is selected but when I select my date is changed and number is still wrong. Can anyone suggest me how to get round this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="_jivemacro_uid_14150321963192612 jive_text_macro jive_macro_code" jivemacro_uid="_14150321963192612"&gt;
&lt;P&gt;Set vSelected1YearStartDate = 'MakeDate($(=Max([Financial Year]))-2, $(=Max([Month])) + 1,1)';&lt;/P&gt;
&lt;P&gt;Set vSelectedMonthStartDate = 'MakeDate($(=Max([Financial Year]))-1, $(=Max([Month])) ,1)';&lt;/P&gt;
&lt;P&gt;Set vSelectedMonthEndDate = 'MonthEnd(MakeDate($(=Max([Financial Year]))-1, $(=Max([Month])),1))';&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now testing label value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14150322545985431 jive_macro_code" jivemacro_uid="_14150322545985431"&gt;
&lt;P&gt;=Count({1&amp;lt;[Member Purchasing Group]={"$(=GetFieldSelections([Purchasing Group]))"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; , [Member Date of Joining] = {"&amp;gt;0&amp;lt;=$(&amp;lt;=$(vSelectedMonthEndDate))"}&amp;gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DISTINCT [Member Code])&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if I choose following values: Financial Year = 2015, Month=10&lt;/P&gt;&lt;P&gt;Variables equal to:&lt;/P&gt;&lt;P&gt;vSelected1YearStartDate = 01/11/2013&lt;/P&gt;&lt;P&gt;vSelectedMonthStartDate = 01/10/2014&lt;/P&gt;&lt;P&gt;vSelectedMonthEndDate = 31/10/2014&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does work with no selection or selecting current year and month but selecting a previous year figure does not change. &lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please not that I have to get all rows "{1}" based on selected date parameters.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Nov 2014 16:37:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-03T16:37:29Z</dc:date>
    <item>
      <title>Set analysis help required</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-required/m-p/757259#M1049471</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 did noticed similar some similar topic &lt;A _jive_internal="true" href="https://community.qlik.com/thread/140623"&gt;here&lt;/A&gt; . But does not work for me.&lt;/P&gt;&lt;P&gt;I am trying to get from selected Year and Month generate a date and get count of &lt;STRONG&gt;all&lt;/STRONG&gt; rows (including unselected) based on calculated date. As this code will be reused many times I've placed into variable. I get values correctly when nothing is selected but when I select my date is changed and number is still wrong. Can anyone suggest me how to get round this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="_jivemacro_uid_14150321963192612 jive_text_macro jive_macro_code" jivemacro_uid="_14150321963192612"&gt;
&lt;P&gt;Set vSelected1YearStartDate = 'MakeDate($(=Max([Financial Year]))-2, $(=Max([Month])) + 1,1)';&lt;/P&gt;
&lt;P&gt;Set vSelectedMonthStartDate = 'MakeDate($(=Max([Financial Year]))-1, $(=Max([Month])) ,1)';&lt;/P&gt;
&lt;P&gt;Set vSelectedMonthEndDate = 'MonthEnd(MakeDate($(=Max([Financial Year]))-1, $(=Max([Month])),1))';&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now testing label value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14150322545985431 jive_macro_code" jivemacro_uid="_14150322545985431"&gt;
&lt;P&gt;=Count({1&amp;lt;[Member Purchasing Group]={"$(=GetFieldSelections([Purchasing Group]))"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; , [Member Date of Joining] = {"&amp;gt;0&amp;lt;=$(&amp;lt;=$(vSelectedMonthEndDate))"}&amp;gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DISTINCT [Member Code])&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if I choose following values: Financial Year = 2015, Month=10&lt;/P&gt;&lt;P&gt;Variables equal to:&lt;/P&gt;&lt;P&gt;vSelected1YearStartDate = 01/11/2013&lt;/P&gt;&lt;P&gt;vSelectedMonthStartDate = 01/10/2014&lt;/P&gt;&lt;P&gt;vSelectedMonthEndDate = 31/10/2014&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does work with no selection or selecting current year and month but selecting a previous year figure does not change. &lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please not that I have to get all rows "{1}" based on selected date parameters.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 16:37:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-required/m-p/757259#M1049471</guid>
      <dc:creator />
      <dc:date>2014-11-03T16:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help required</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-required/m-p/757260#M1049473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count({1&amp;lt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;[Member Purchasing Group]&lt;/SPAN&gt;={$(=GetFieldSelections(&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;[Member Purchasing Group]&lt;/SPAN&gt;))}, &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt; [Member Date of Joining]&lt;/SPAN&gt; = {"&amp;gt;0&amp;lt;=$(vSelectedMonthEndDate)"}&amp;gt;}&amp;nbsp;&amp;nbsp; DISTINCT &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;[Member Code]&lt;/SPAN&gt;)&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count({1&amp;lt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;[Member Purchasing Group]&lt;/SPAN&gt;=p(&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;[Member Purchasing Group]&lt;/SPAN&gt;), &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt; [Member Date of Joining]&lt;/SPAN&gt; = {"&amp;gt;0&amp;lt;=$(vSelectedMonthEndDate)"}&amp;gt;}&amp;nbsp;&amp;nbsp; DISTINCT &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;[Member Code]&lt;/SPAN&gt;)&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make a chart with the expression, remove the label and you can see the set analysis as in image (above all useful for date)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/70407_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 19:59:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-required/m-p/757260#M1049473</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-11-03T19:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help required</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-required/m-p/757261#M1049475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but looks like still not working. Now is affected by selection but showing incorrect figures.&lt;/P&gt;&lt;P&gt;Adding to chart shows also incorrect figures. Figures should accumulative by year but it is not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Results from first query does not return any results, and second one return incorrect figures:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="image2.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/70448_image2.png" style="font-size: 10pt; line-height: 1.5em;" /&gt;&lt;/P&gt;&lt;P&gt;other selection:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="image1.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/70441_image1.png" style="font-size: 10pt; line-height: 1.5em;" /&gt;&lt;/P&gt;&lt;P&gt;The correct figure for the top one should 749 members. Or 1446 if first condition excluded (Purchasing Group).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: What the p() function does?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2014 10:03:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-required/m-p/757261#M1049475</guid>
      <dc:creator />
      <dc:date>2014-11-04T10:03:39Z</dc:date>
    </item>
  </channel>
</rss>

