<?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: use variable as result of another variable in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/use-variable-as-result-of-another-variable-in-set-analysis/m-p/1210172#M388290</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I will try to explain something more.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I have to listboxes , one with the dimension year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;and one with the dimension year_to_compare_with&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;When i select year , then&amp;nbsp; all periods should be selected where the enddate of the period &amp;lt; today()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Every period has a number, a period is a kind of a quarter but begin and enddate don't match calendar quarters. the number of a period of a period is calculated by : year*4+quarter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;This period number is a field in every record.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;To store the&amp;nbsp; periodnumber in a variable&amp;nbsp; called v_periodnumber&amp;nbsp; I use a Mastercalendar table with next expression :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;=max(distinct {1&amp;lt;MasterCalander.period_enddate = {"=max(MasterCalander.&lt;SPAN style="font-size: 13.3333px;"&gt;period_enddate&lt;/SPAN&gt;_Educator) &amp;lt; vDdate_today"}&amp;gt;} periodnumber)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;To get the periodnumber where to compare with I use another variable v_periodnumer_to_compare with the expression :&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;=v_periodnumber –((year-year_to_compare_with-year)*4)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Both variables show correct values in a textbox&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;But when I use the expression&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;count( distinct {1&amp;lt;periodnumber= {=$(v_period_to_compare)}&amp;gt;}employees) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I get 0 as a result&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Your solution didn't give a good result neither &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 06 Nov 2016 13:00:56 GMT</pubDate>
    <dc:creator>curiousfellow</dc:creator>
    <dc:date>2016-11-06T13:00:56Z</dc:date>
    <item>
      <title>use variable as result of another variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/use-variable-as-result-of-another-variable-in-set-analysis/m-p/1210170#M388288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable as a result of another variable.&lt;/P&gt;&lt;P&gt;In a textbox the correct value of this variable is displayed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to use this variable in set analysis.&lt;/P&gt;&lt;P&gt;I think I tried every possible syntax but nothing works.&lt;/P&gt;&lt;P&gt;When I use a number instead of this variable in set analysis I get the correct results too&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I think the syntax should be =&lt;/P&gt;&lt;P&gt;count(distinct {&amp;lt;year= {'$(vYear)}&amp;gt;} &lt;SPAN style="font-size: 13.3333px;"&gt;employees)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 13.3333px;"&gt;count(distinct {&amp;lt;year= {'$(=vYear)'}&amp;gt;} employees)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;double quotes didn't help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Nov 2016 11:46:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/use-variable-as-result-of-another-variable-in-set-analysis/m-p/1210170#M388288</guid>
      <dc:creator>curiousfellow</dc:creator>
      <dc:date>2016-11-06T11:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: use variable as result of another variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/use-variable-as-result-of-another-variable-in-set-analysis/m-p/1210171#M388289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do you define vYear? May be you need a dollar sign expansion for your variable also?&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: 13.3333px;"&gt;&lt;STRONG&gt;Count(Distinct {&amp;lt;year= {"$(=&lt;SPAN style="color: #ff0000;"&gt;$(&lt;/SPAN&gt;vYear&lt;SPAN style="color: #ff0000;"&gt;)&lt;/SPAN&gt;)"}&amp;gt;} employees)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Nov 2016 12:02:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/use-variable-as-result-of-another-variable-in-set-analysis/m-p/1210171#M388289</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-06T12:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: use variable as result of another variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/use-variable-as-result-of-another-variable-in-set-analysis/m-p/1210172#M388290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I will try to explain something more.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I have to listboxes , one with the dimension year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;and one with the dimension year_to_compare_with&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;When i select year , then&amp;nbsp; all periods should be selected where the enddate of the period &amp;lt; today()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Every period has a number, a period is a kind of a quarter but begin and enddate don't match calendar quarters. the number of a period of a period is calculated by : year*4+quarter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;This period number is a field in every record.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;To store the&amp;nbsp; periodnumber in a variable&amp;nbsp; called v_periodnumber&amp;nbsp; I use a Mastercalendar table with next expression :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;=max(distinct {1&amp;lt;MasterCalander.period_enddate = {"=max(MasterCalander.&lt;SPAN style="font-size: 13.3333px;"&gt;period_enddate&lt;/SPAN&gt;_Educator) &amp;lt; vDdate_today"}&amp;gt;} periodnumber)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;To get the periodnumber where to compare with I use another variable v_periodnumer_to_compare with the expression :&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;=v_periodnumber –((year-year_to_compare_with-year)*4)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Both variables show correct values in a textbox&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;But when I use the expression&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;count( distinct {1&amp;lt;periodnumber= {=$(v_period_to_compare)}&amp;gt;}employees) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I get 0 as a result&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Your solution didn't give a good result neither &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Nov 2016 13:00:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/use-variable-as-result-of-another-variable-in-set-analysis/m-p/1210172#M388290</guid>
      <dc:creator>curiousfellow</dc:creator>
      <dc:date>2016-11-06T13:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: use variable as result of another variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/use-variable-as-result-of-another-variable-in-set-analysis/m-p/1210173#M388291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;problem solved, allthough I don't know what is different from the expression I used before&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Nov 2016 13:41:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/use-variable-as-result-of-another-variable-in-set-analysis/m-p/1210173#M388291</guid>
      <dc:creator>curiousfellow</dc:creator>
      <dc:date>2016-11-06T13:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: use variable as result of another variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/use-variable-as-result-of-another-variable-in-set-analysis/m-p/1210174#M388292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please mark this discussion as answered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;answered‌&lt;/P&gt;&lt;P&gt;resolved‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Nov 2016 14:40:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/use-variable-as-result-of-another-variable-in-set-analysis/m-p/1210174#M388292</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-11-06T14:40:14Z</dc:date>
    </item>
  </channel>
</rss>

