<?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: A variable with IF and a parameter doesn't work in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007641#M83372</link>
    <description>&lt;P&gt;Not sure where the $1 is referring to.&lt;/P&gt;
&lt;P&gt;If you do this:&amp;nbsp;If($(vRepDelivYaad)='2',LightGray(),LightGreen())&amp;nbsp; and you enter the value 2 in the variable in an inputbox it works as expected.&lt;/P&gt;
&lt;P&gt;vRepDelivYaad is comparing to the value $1 that should be entered in the variable like this:&lt;/P&gt;
&lt;P&gt;In your script:&lt;/P&gt;
&lt;P&gt;LOAD * Inline [&lt;/P&gt;
&lt;P&gt;KPIID, Formula&lt;/P&gt;
&lt;P&gt;abc , Sum(Volume)&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;SET UDF_Formula = Only({1&amp;lt;_KPIID = {$1}&amp;gt;}_KPI_Formula);&lt;/P&gt;
&lt;P&gt;In your expression: = $(UDF_Formula(abc)) will resolve to the expression Sum(Volume)&lt;/P&gt;
&lt;P&gt;$1 is replace by abc in this exaple.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Nov 2022 14:22:21 GMT</pubDate>
    <dc:creator>Michiel_QV_Fan</dc:creator>
    <dc:date>2022-11-22T14:22:21Z</dc:date>
    <item>
      <title>A variable with IF and a parameter doesn't work</title>
      <link>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2006750#M83304</link>
      <description>&lt;P&gt;Hi People,&lt;/P&gt;
&lt;P&gt;I created a variable to calculate a background color with the following expression:&lt;/P&gt;
&lt;P&gt;=If($(vRepDelivYaad)=&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#993366"&gt;$1&lt;/FONT&gt;&lt;/STRONG&gt;,vColorDarkGrey,vColorLightGrey)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I get the message: Error in expression.&lt;/P&gt;
&lt;P&gt;Adding literals removes the error message, but always return the false (vColorLightGrey)&lt;/P&gt;
&lt;P&gt;=If($(vRepDelivYaad)='&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#993366"&gt;$1'&lt;/FONT&gt;&lt;/STRONG&gt;,vColorDarkGrey,vColorLightGrey) .&lt;/P&gt;
&lt;P&gt;Calling the variable either&amp;nbsp;$(vTest(2)) or&amp;nbsp;$(vTest('2')) doesn't resolve the issue.&lt;/P&gt;
&lt;P&gt;Any Idea?&lt;/P&gt;
&lt;P&gt;Thanks in Advance!&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2022 15:55:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2006750#M83304</guid>
      <dc:creator>dana</dc:creator>
      <dc:date>2022-11-20T15:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: A variable with IF and a parameter doesn't work</title>
      <link>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007641#M83372</link>
      <description>&lt;P&gt;Not sure where the $1 is referring to.&lt;/P&gt;
&lt;P&gt;If you do this:&amp;nbsp;If($(vRepDelivYaad)='2',LightGray(),LightGreen())&amp;nbsp; and you enter the value 2 in the variable in an inputbox it works as expected.&lt;/P&gt;
&lt;P&gt;vRepDelivYaad is comparing to the value $1 that should be entered in the variable like this:&lt;/P&gt;
&lt;P&gt;In your script:&lt;/P&gt;
&lt;P&gt;LOAD * Inline [&lt;/P&gt;
&lt;P&gt;KPIID, Formula&lt;/P&gt;
&lt;P&gt;abc , Sum(Volume)&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;SET UDF_Formula = Only({1&amp;lt;_KPIID = {$1}&amp;gt;}_KPI_Formula);&lt;/P&gt;
&lt;P&gt;In your expression: = $(UDF_Formula(abc)) will resolve to the expression Sum(Volume)&lt;/P&gt;
&lt;P&gt;$1 is replace by abc in this exaple.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 14:22:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007641#M83372</guid>
      <dc:creator>Michiel_QV_Fan</dc:creator>
      <dc:date>2022-11-22T14:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: A variable with IF and a parameter doesn't work</title>
      <link>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007702#M83379</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thanks for your suggestion..&lt;/P&gt;
&lt;P&gt;The variable&amp;nbsp;&lt;SPAN&gt;vRepDelivYaad is updated by the button, which its background color is defined by the formula:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=If($(vRepDelivYaad)=&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#993366"&gt;$1&lt;/FONT&gt;&lt;/STRONG&gt;,vColorDarkGrey,vColorLightGrey)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Another words,&amp;nbsp;vRepDelivYaad can't be replaced by script.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 15:17:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007702#M83379</guid>
      <dc:creator>dana</dc:creator>
      <dc:date>2022-11-22T15:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: A variable with IF and a parameter doesn't work</title>
      <link>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007714#M83381</link>
      <description>&lt;P&gt;What kind of&amp;nbsp; value will replace $1? your variable is comparing like 1=1&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;$(vRepDelivYaad) = X&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 15:25:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007714#M83381</guid>
      <dc:creator>Michiel_QV_Fan</dc:creator>
      <dc:date>2022-11-22T15:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: A variable with IF and a parameter doesn't work</title>
      <link>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007733#M83382</link>
      <description>&lt;P&gt;Exactly!&lt;/P&gt;
&lt;P&gt;the idea is to use one expression for all buttons.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 15:51:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007733#M83382</guid>
      <dc:creator>dana</dc:creator>
      <dc:date>2022-11-22T15:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: A variable with IF and a parameter doesn't work</title>
      <link>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007949#M83391</link>
      <description>&lt;P&gt;Sorry, I still don't get what your goal is.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 07:09:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007949#M83391</guid>
      <dc:creator>Michiel_QV_Fan</dc:creator>
      <dc:date>2022-11-23T07:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: A variable with IF and a parameter doesn't work</title>
      <link>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007969#M83392</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'll be more specific:&lt;/P&gt;
&lt;P&gt;There are a few buttons which are used to toggle between display options: (action is update variable&amp;nbsp;&lt;SPAN&gt;vRepDelivYaad)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The current choice is displayed with the black background.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Buttons.png" style="width: 665px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/94370i642DCDB71684037E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Buttons.png" alt="Buttons.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So instead of writing a similar background expression for&amp;nbsp; each button:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=If($(vRepDelivYaad)=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#993366"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt;,vColorDarkGrey,vColorLightGrey)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=If($(vRepDelivYaad)=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#993366"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt;,vColorDarkGrey,vColorLightGrey)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I thought of using another variable with the same expression and a parameter&amp;nbsp; , e.g., vButtonBackground:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=If($(vRepDelivYaad)=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#993366"&gt;$1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt;,vColorDarkGrey,vColorLightGrey)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;called from each button:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;$(vButtonBackground(1))&lt;/P&gt;
&lt;P&gt;$(vButtonBackground(2))&lt;/P&gt;
&lt;P&gt;Does it make sense?&lt;/P&gt;
&lt;P&gt;Thanks for willing to help me!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 08:02:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/A-variable-with-IF-and-a-parameter-doesn-t-work/m-p/2007969#M83392</guid>
      <dc:creator>dana</dc:creator>
      <dc:date>2022-11-23T08:02:50Z</dc:date>
    </item>
  </channel>
</rss>

