<?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: If statement within set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737043#M263581</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I really like where this is headed but it is new to me so a question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would the expression have just one variable in it? I know in theory what you are saying but struggling to figure out what the expression would look like and how it would change depending on button selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Aug 2014 13:00:55 GMT</pubDate>
    <dc:creator>zagzebski</dc:creator>
    <dc:date>2014-08-25T13:00:55Z</dc:date>
    <item>
      <title>If statement within set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737038#M263576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to find the most efficient way to address two flags that we use... (1) a flag that is for &lt;STRONG&gt;Year to Date&lt;/STRONG&gt; amount and (2) a flag that is for the &lt;STRONG&gt;last 12 months&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to incorporate the best way to address the flags (above) when a user clicks the "&lt;STRONG&gt;YTD&lt;/STRONG&gt;" button or the "&lt;STRONG&gt;TMT&lt;/STRONG&gt;" (twelve months trailing) button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what is the most efficient way to choose one of these expressions based on the YTD or TMT selection. Is there way to have an If statment WITHIN the set analysis of one expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have about 75 charts I have to address this with so looking for the most efficient way!&amp;nbsp; The stripped down version of the expressions I need based on user selection:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;sum({&amp;lt;YTD={'1'}&amp;gt;}Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;sum({&amp;lt;TMT={'1'}&amp;gt;}Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 12:20:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737038#M263576</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2014-08-25T12:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: If statement within set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737039#M263577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should be IF outside set analysis and a simple one like:&lt;/P&gt;&lt;P&gt;=If( &amp;lt;TMT condition&amp;gt;, &lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;sum({&amp;lt;TMT={'1'}&amp;gt;}Amount) , &lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;sum({&amp;lt;YTD={'1'}&amp;gt;}Amount) )&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-size: 10.5pt; font-family: 'Helvetica','sans-serif';"&gt;Or, you might want to put another condition in else part like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-size: 10.5pt; font-family: 'Helvetica','sans-serif';"&gt;If( &amp;lt;TMT condition&amp;gt;, &lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;sum({&amp;lt;TMT={'1'}&amp;gt;}Amount) , If( &amp;lt;YTD Condition&amp;gt;, &lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;sum({&amp;lt;YTD={'1'}&amp;gt;}Amount) ))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 12:27:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737039#M263577</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-08-25T12:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: If statement within set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737040#M263578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Creating a couple of variables&lt;/LI&gt;&lt;LI&gt;Having your buttons set the variable values&lt;UL&gt;&lt;LI&gt;As in YTD button sets it to &lt;SPAN style="color: #666666; font-family: Helvetica, sans-serif; font-size: 14px;"&gt;&lt;EM&gt;sum({&amp;lt;YTD={'1'}&amp;gt;}Amount&lt;/EM&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Use a dollar expansion of the variable in your expression&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 12:29:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737040#M263578</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-25T12:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: If statement within set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737041#M263579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if the flags are always contrary (means YTD = 1 while TMT = 0 and vice versa) you do not need an if statement.&lt;/P&gt;&lt;P&gt;are the flags built in your calendar and connected to the facttable?&lt;/P&gt;&lt;P&gt;why&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Amount)&lt;/P&gt;&lt;P&gt;is not enough? pressing the button should select YTD or TMT and the correct data should be selected. I would build my datamodel to do so&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 12:39:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737041#M263579</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-25T12:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: If statement within set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737042#M263580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well my expressions have a little more in that each chart accounts for 2 previous time frames so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression 1 : YTD this year or Last 12 months (depending on YTD or TMT selection)&lt;/P&gt;&lt;P&gt;Expression 2: YTD last year or prior 13-24 months (depending on YTD or TMT selection)&lt;/P&gt;&lt;P&gt;Expression 3: YTD 2 years prior or prior 25-36 months (depending on YTD or TMT selection)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have additional criteria in the set that includes the max, max-1, max-2 for year in the expressions, but I do not want that part of the set when TMT is selected as it will cross multiple years (ie August 2013-July 2014 when TMT is selected)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 12:54:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737042#M263580</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2014-08-25T12:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: If statement within set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737043#M263581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I really like where this is headed but it is new to me so a question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would the expression have just one variable in it? I know in theory what you are saying but struggling to figure out what the expression would look like and how it would change depending on button selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 13:00:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737043#M263581</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2014-08-25T13:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: If statement within set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737044#M263582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a similiar application where I show the YTD or TMT data of the year and the previous year&lt;/P&gt;&lt;P&gt;my expression is&lt;/P&gt;&lt;P&gt;sum ({&amp;gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Kalenderdates={'&amp;gt;=$(=vDateFrom)&amp;lt;=$(=vDateTo)'},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )FactValue&lt;/P&gt;&lt;P&gt;The variables vDateFrom and vDateTo are set (depending on YTD or TMT)&lt;/P&gt;&lt;P&gt;e.g. 1.1.2014 to 30.06.2014 YTD or 1.3.2014 to 30.4.2014 TMT&lt;/P&gt;&lt;P&gt;A similiar expression and variables can do it for Prev Year and Year -2&lt;/P&gt;&lt;P&gt;in my application the user switches between YTD and&amp;nbsp; TMT using a button&lt;/P&gt;&lt;P&gt;Result: my expressions in many charts are much easier to read and maintain&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 13:05:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737044#M263582</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-25T13:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: If statement within set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737045#M263583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I like it. Just kind of new to me so thinking about what the specifics would be. So you click on YTD and it populates the variable with one expression, then if they click on the TMT button it populates the variable with a different expression? Then the variable(s) is utilized in the expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 13:21:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737045#M263583</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2014-08-25T13:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: If statement within set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737046#M263584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, that's it. my variable&lt;/P&gt;&lt;P&gt;vDateFrom = if YTD,yearStart(SelDate),monthstart(SelDate)&amp;nbsp; (shows principal)&lt;/P&gt;&lt;P&gt;vDateTo = monthend(SelDate)&lt;/P&gt;&lt;P&gt;if minimum date to report is month,&lt;/P&gt;&lt;P&gt;User selects July!&lt;/P&gt;&lt;P&gt;YTD: vDateFrom: 1.1.2014; vDateTo 31.7.2014&lt;/P&gt;&lt;P&gt;TMT vDateFrom: 1.7.2014; vDateTo: 31.7.2014&lt;/P&gt;&lt;P&gt;if you select more than 1 month (only for TMT) then the variables correspond to the months&lt;/P&gt;&lt;P&gt;hope that gives you an idea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 13:28:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737046#M263584</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-25T13:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: If statement within set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737047#M263585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And the additional twist (sorry) is that if neither YTD or TMT buttons are selected the expression should just respected whatever calendar dates are selected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 13:29:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737047#M263585</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2014-08-25T13:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: If statement within set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737048#M263586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in my case there is YTD or TMT selected, if in your case neither of them needs to be selected, so what calendar should be used? you must provide a third scenario for that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 13:37:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737048#M263586</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-25T13:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: If statement within set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737049#M263587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! I am going to run with this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 13:44:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-within-set-analysis/m-p/737049#M263587</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2014-08-25T13:44:02Z</dc:date>
    </item>
  </channel>
</rss>

