<?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 Qlikview IF statement &amp;amp; AGGR in variable parameter not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Qlikview-IF-statement-amp-AGGR-in-variable-parameter-not-working/m-p/1932427#M1219019</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Hey everyone,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I built a variable to dynamically alter the number formatting of whatever expression I use it with, by means of a variable parameter. It works perfectly on normal expressions, but seems to completely break when there are &lt;STRONG&gt;IF&lt;/STRONG&gt; conditions and/or&amp;nbsp;&lt;STRONG&gt;AGGR&lt;/STRONG&gt; functions within the expression. I'm running on Qlikview 11.20&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Variables used:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;vR&lt;/STRONG&gt;=Just a button to alternate between the number formats&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;vNumberFormat&lt;/STRONG&gt;&lt;EM&gt;=&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Pick(Match($(vR), 0, 1, 2, 3),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'#,##0  ;(#,##0)',&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'#,##0.00  ;(#,##0.00)',&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'#,##0.0  ;(#,##0.0)',&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'#,##0  ;(#,##0)'&lt;/EM&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;vDivide&lt;/STRONG&gt;&lt;EM&gt;=&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Pick(Match(vR, 0, 1, 2, 3),&lt;BR /&gt;'1',&lt;BR /&gt;'1',&lt;BR /&gt;'1000000',&lt;BR /&gt;'1000')&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;vNumFormat&lt;/STRONG&gt;=&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Num((&lt;STRONG&gt;$1&lt;/STRONG&gt; / $(vDivide)), '$(vNumberFormat)')&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Example of an expression using the variable which returns an error:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;=$(vNumFormat(if(Dimensionality()=1,&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Aggr(RangeSum(Above(sum({&amp;lt;FIN_YEAR={$(vCURRENTYEAR)}&amp;gt;} IS_ACTUAL_MTD),0,RowNo(TOTAL))),[TOTAL I/S]),&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;if(match([IS LEVEL 1],'Income', 'Equity-accounted earnings'),sum({&amp;lt;FIN_YEAR={$(vCURRENTYEAR)}&amp;gt;} IS_ACTUAL_MTD),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if(match([IS LEVEL 1],'Expenses','Finance charges', 'Tax'), sum({&amp;lt;FIN_YEAR={$(vCURRENTYEAR)}&amp;gt;} IS_ACTUAL_MTD)))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;)))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated, thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 18 May 2022 12:20:29 GMT</pubDate>
    <dc:creator>Enrique</dc:creator>
    <dc:date>2022-05-18T12:20:29Z</dc:date>
    <item>
      <title>Qlikview IF statement &amp; AGGR in variable parameter not working</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-IF-statement-amp-AGGR-in-variable-parameter-not-working/m-p/1932427#M1219019</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hey everyone,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I built a variable to dynamically alter the number formatting of whatever expression I use it with, by means of a variable parameter. It works perfectly on normal expressions, but seems to completely break when there are &lt;STRONG&gt;IF&lt;/STRONG&gt; conditions and/or&amp;nbsp;&lt;STRONG&gt;AGGR&lt;/STRONG&gt; functions within the expression. I'm running on Qlikview 11.20&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Variables used:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;vR&lt;/STRONG&gt;=Just a button to alternate between the number formats&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;vNumberFormat&lt;/STRONG&gt;&lt;EM&gt;=&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Pick(Match($(vR), 0, 1, 2, 3),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'#,##0  ;(#,##0)',&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'#,##0.00  ;(#,##0.00)',&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'#,##0.0  ;(#,##0.0)',&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'#,##0  ;(#,##0)'&lt;/EM&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;vDivide&lt;/STRONG&gt;&lt;EM&gt;=&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Pick(Match(vR, 0, 1, 2, 3),&lt;BR /&gt;'1',&lt;BR /&gt;'1',&lt;BR /&gt;'1000000',&lt;BR /&gt;'1000')&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;vNumFormat&lt;/STRONG&gt;=&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Num((&lt;STRONG&gt;$1&lt;/STRONG&gt; / $(vDivide)), '$(vNumberFormat)')&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Example of an expression using the variable which returns an error:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;=$(vNumFormat(if(Dimensionality()=1,&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Aggr(RangeSum(Above(sum({&amp;lt;FIN_YEAR={$(vCURRENTYEAR)}&amp;gt;} IS_ACTUAL_MTD),0,RowNo(TOTAL))),[TOTAL I/S]),&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;if(match([IS LEVEL 1],'Income', 'Equity-accounted earnings'),sum({&amp;lt;FIN_YEAR={$(vCURRENTYEAR)}&amp;gt;} IS_ACTUAL_MTD),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if(match([IS LEVEL 1],'Expenses','Finance charges', 'Tax'), sum({&amp;lt;FIN_YEAR={$(vCURRENTYEAR)}&amp;gt;} IS_ACTUAL_MTD)))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;)))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated, thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 12:20:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-IF-statement-amp-AGGR-in-variable-parameter-not-working/m-p/1932427#M1219019</guid>
      <dc:creator>Enrique</dc:creator>
      <dc:date>2022-05-18T12:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview IF statement &amp; AGGR in variable parameter not working</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-IF-statement-amp-AGGR-in-variable-parameter-not-working/m-p/1932459#M1219020</link>
      <description>&lt;P&gt;i would expect passing commas being a problem, as this is the special character to seperate different parameter inputs.&lt;/P&gt;
&lt;P&gt;try to pass something else, like ;, and your variable can be wrapped in a replace(&amp;lt;exp&amp;gt;, ';', ',')&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 12:40:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-IF-statement-amp-AGGR-in-variable-parameter-not-working/m-p/1932459#M1219020</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2022-05-18T12:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview IF statement &amp; AGGR in variable parameter not working</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-IF-statement-amp-AGGR-in-variable-parameter-not-working/m-p/1934558#M1219111</link>
      <description>&lt;P&gt;Thank you for the reply.&lt;/P&gt;
&lt;P&gt;While that does fix some of its issues, it still seems to be expecting a "missing" ')'.&lt;/P&gt;
&lt;P&gt;It also seems to not see it as numeric anymore either after the replace.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 05:21:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-IF-statement-amp-AGGR-in-variable-parameter-not-working/m-p/1934558#M1219111</guid>
      <dc:creator>Enrique</dc:creator>
      <dc:date>2022-05-24T05:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview IF statement &amp; AGGR in variable parameter not working</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-IF-statement-amp-AGGR-in-variable-parameter-not-working/m-p/1934584#M1219116</link>
      <description>&lt;P&gt;What you are trying to do is not possible - at least not in a sensible way - because the comma-treatment as parameter-delimiter will always cause trouble.&lt;/P&gt;
&lt;P&gt;Often you may find technically ways to replace functions which needs parameter with some without them and/or write them in another syntax and/or applying any comma-replacement - but such measures could become quite complex, much more as originally logic and they will mostly remain particular solutions - means not applicable as a general approach.&lt;/P&gt;
&lt;P&gt;Therefore keep it as simple as possible and just use it as:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Num(&lt;STRONG&gt;YourExpression&amp;nbsp;&lt;/STRONG&gt;/ $(vDivide), '$(vNumberFormat)')&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 06:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-IF-statement-amp-AGGR-in-variable-parameter-not-working/m-p/1934584#M1219116</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-05-24T06:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview IF statement &amp; AGGR in variable parameter not working</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-IF-statement-amp-AGGR-in-variable-parameter-not-working/m-p/1934594#M1219117</link>
      <description>&lt;P&gt;That is what I ended up going with, though I had still wondered if there could have been a more elegant solution. Now I can sleep soundly, thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 07:07:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-IF-statement-amp-AGGR-in-variable-parameter-not-working/m-p/1934594#M1219117</guid>
      <dc:creator>Enrique</dc:creator>
      <dc:date>2022-05-24T07:07:06Z</dc:date>
    </item>
  </channel>
</rss>

