<?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 .. then... variables .... please help! in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285765#M583083</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added a new variable "vSB" to the variable editor. This is the formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="111.gif" class="jive-image-thumbnail jive-image" height="175" onclick="" src="https://community.qlik.com/legacyfs/online/8365_111.gif" width="539" /&gt;&lt;/P&gt;&lt;P&gt;﻿But I get the expected result...﻿: I'm using a &lt;/P&gt;&lt;DIV&gt;pivot chart based on a daily calculation but the variable's calculation is not based on the daily DIMENSION, it's global &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;green = expected value (daily)&lt;/DIV&gt;&lt;DIV&gt;red = variable's calculation (vSB)&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;IMG alt="222.gif" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/8366_222.gif" width="450" /&gt;&lt;/DIV&gt;&lt;DIV&gt;Any idea?&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;regards,&lt;/DIV&gt;&lt;DIV&gt;jup&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Nov 2011 11:01:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-11-01T11:01:26Z</dc:date>
    <item>
      <title>if .. then... variables .... please help!</title>
      <link>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285763#M583081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take a look at:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="22222.gif" class="jive-image" src="https://community.qlik.com/legacyfs/online/8318_22222.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="3333.gif" class="jive-image-thumbnail jive-image" height="19" onclick="" src="https://community.qlik.com/legacyfs/online/8320_3333.gif" width="652" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to do it easyer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var SB = sum("sb")&lt;/P&gt;&lt;P&gt;var SKY = sum(Sky)&lt;/P&gt;&lt;P&gt;if SB &amp;gt; SKY then SB else SKY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;???&lt;/P&gt;&lt;P&gt;I'm asking because I have to integrate many other items like SB or SKY in the formula and it would get very complex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I can't use a QLIKVIEW VARIABLE ("set" or "let") because this is a formula based on a diagram chart with different dimensions...!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;jup&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 16:32:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285763#M583081</guid>
      <dc:creator />
      <dc:date>2011-10-31T16:32:11Z</dc:date>
    </item>
    <item>
      <title>if .. then... variables .... please help!</title>
      <link>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285764#M583082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Go to variable editor and create:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vSB: sum(HEL_PLACEMENT_={'728 X 90'}) HEL_DATE_IMP)&lt;/P&gt;&lt;P&gt;similarly vSky. In the chart expression would be: if($(vSB)&amp;gt;$(vSky),'SB','SKY')&lt;/P&gt;&lt;P&gt;Since, there is no equals sign for variable expression it will be computed dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: The field names are not correct in my code, please use appropiate ones.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KIran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 16:53:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285764#M583082</guid>
      <dc:creator />
      <dc:date>2011-10-31T16:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: if .. then... variables .... please help!</title>
      <link>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285765#M583083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added a new variable "vSB" to the variable editor. This is the formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="111.gif" class="jive-image-thumbnail jive-image" height="175" onclick="" src="https://community.qlik.com/legacyfs/online/8365_111.gif" width="539" /&gt;&lt;/P&gt;&lt;P&gt;﻿But I get the expected result...﻿: I'm using a &lt;/P&gt;&lt;DIV&gt;pivot chart based on a daily calculation but the variable's calculation is not based on the daily DIMENSION, it's global &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;green = expected value (daily)&lt;/DIV&gt;&lt;DIV&gt;red = variable's calculation (vSB)&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;IMG alt="222.gif" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/8366_222.gif" width="450" /&gt;&lt;/DIV&gt;&lt;DIV&gt;Any idea?&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;regards,&lt;/DIV&gt;&lt;DIV&gt;jup&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 11:01:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285765#M583083</guid>
      <dc:creator />
      <dc:date>2011-11-01T11:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: if .. then... variables .... please help!</title>
      <link>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285766#M583084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Remove "=" sign in the variable and in the chart make the expression as =$(vSB)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 11:19:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285766#M583084</guid>
      <dc:creator />
      <dc:date>2011-11-01T11:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: if .. then... variables .... please help!</title>
      <link>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285767#M583085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;﻿You did it! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Great job!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 12:06:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285767#M583085</guid>
      <dc:creator />
      <dc:date>2011-11-01T12:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: if .. then... variables .... please help!</title>
      <link>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285768#M583086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran, &lt;/P&gt;&lt;P&gt;maybe you could help me with the next thing &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;Now, take a look at my (your) formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="111.gif" class="jive-image" src="https://community.qlik.com/legacyfs/online/8368_111.gif" /&gt;&lt;/P&gt;&lt;P&gt;It works great &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to integrate some other items to check, not only vSB and vSKY.&lt;/P&gt;&lt;P&gt;I have to add vMREC, vPOP, vINTER, vSTICKY ... to the formula.&lt;/P&gt;&lt;P&gt;But if I will only add "MREC", my formula will grow and grow and get more complex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="222.gif" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/8370_222.gif" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALso my the application speed will slow down (to calculate the object)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any idea to create a shorter (easyer and faster) formula...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx again,&lt;/P&gt;&lt;P&gt;jup&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 13:43:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285768#M583086</guid>
      <dc:creator />
      <dc:date>2011-11-01T13:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: if .. then... variables .... please help!</title>
      <link>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285769#M583087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jup,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good that it worked..!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right, more memory will be consumed. I have an alternative that can work in straight table (for Pivot Table you need QV 11 &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/silly.png" /&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a straight table with expressions, one each for a variable. Label the expressions as ValSB, ValSKY etc... This means that you computed each of these expressions for the dimensions. Create additional expressions in the same table but using the expression lables instead of the variables as :&lt;/P&gt;&lt;P&gt;If(ValSB&amp;gt;ValSKY,ValSB,ValSKY) etc.. This would decrease the calculation time. Now you can go to presentation tab and hide these columns ValSB, ValSKY etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To contrast the ways:&lt;/P&gt;&lt;P&gt;In the former the expression is computed for each of the dimensions everytime variable is called ie., In your current expression, value of SB is calculated twice if the condition is true. In the latter expression is only computed once for the first time and used later on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this wont work for Pivot table as you cannot hide the expressions (which is there in QV11) but this is the best Idea I have as of now. Let me know if you have a better alternative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 13:59:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-then-variables-please-help/m-p/285769#M583087</guid>
      <dc:creator />
      <dc:date>2011-11-01T13:59:17Z</dc:date>
    </item>
  </channel>
</rss>

