<?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 expression based on variable value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-expression-based-on-variable-value/m-p/813868#M471191</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'm using QlikView Components to generate a master calendar table and set analysis variables. This&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; allows me to easily create expressions for the current year to date and comparisons to the previous year. For example: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Total amount in year to date: &lt;EM&gt;Sum($(vSetYTD) Amount)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Total amount in the previous year to date: &lt;EM&gt;Sum($(vSetPreviousYearYTD) Amount)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My next goal is to provide the ability to select the period used in the set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do this I have created three text area objects, which set a variable &lt;EM&gt;vSetPeriodSelection&lt;/EM&gt; to 'YTD', 'MTD', and 'QTD' respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried expressions such as &lt;EM&gt;Sum($(IF(vSetPeriodSelection = 'YTD', vSetYTD, IF(vSetPeriodSelection = 'QTD', vSetQTD, vSetMTD))) Amount)&lt;/EM&gt; without any success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is how do I use the value of this variable to determine the variable used in the set expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 29 Mar 2015 23:49:27 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-03-29T23:49:27Z</dc:date>
    <item>
      <title>Set analysis expression based on variable value</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-expression-based-on-variable-value/m-p/813868#M471191</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'm using QlikView Components to generate a master calendar table and set analysis variables. This&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; allows me to easily create expressions for the current year to date and comparisons to the previous year. For example: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Total amount in year to date: &lt;EM&gt;Sum($(vSetYTD) Amount)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Total amount in the previous year to date: &lt;EM&gt;Sum($(vSetPreviousYearYTD) Amount)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My next goal is to provide the ability to select the period used in the set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do this I have created three text area objects, which set a variable &lt;EM&gt;vSetPeriodSelection&lt;/EM&gt; to 'YTD', 'MTD', and 'QTD' respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried expressions such as &lt;EM&gt;Sum($(IF(vSetPeriodSelection = 'YTD', vSetYTD, IF(vSetPeriodSelection = 'QTD', vSetQTD, vSetMTD))) Amount)&lt;/EM&gt; without any success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is how do I use the value of this variable to determine the variable used in the set expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Mar 2015 23:49:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-expression-based-on-variable-value/m-p/813868#M471191</guid>
      <dc:creator />
      <dc:date>2015-03-29T23:49:27Z</dc:date>
    </item>
  </channel>
</rss>

