<?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 different variable formula based on a field selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/different-variable-formula-based-on-a-field-selection/m-p/2110573#M1224479</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am have 2 different variables, each one has a different formula:&lt;/P&gt;
&lt;P&gt;ValueSelected =&amp;nbsp;count(distinct if([FieldSelected]='X',0))&lt;/P&gt;
&lt;P&gt;Variable1 = [MyField1]+[myField2]-[myField3] e.g. [10] + [5] - [1] = 14&lt;/P&gt;
&lt;P&gt;Variable2=&amp;nbsp;Money(Alt(Sum([myField]), 0))&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the user selects a specific value, I need it to go to variable 1, if not, then variable 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I have been trying so far but it hasn't worked:&lt;/P&gt;
&lt;P&gt;=if([ValueSelected] = 1, $(Variable2),$(Variable1))&lt;/P&gt;
&lt;P&gt;How can I do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2023 21:12:01 GMT</pubDate>
    <dc:creator>VC1258</dc:creator>
    <dc:date>2023-08-28T21:12:01Z</dc:date>
    <item>
      <title>different variable formula based on a field selection</title>
      <link>https://community.qlik.com/t5/QlikView/different-variable-formula-based-on-a-field-selection/m-p/2110573#M1224479</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am have 2 different variables, each one has a different formula:&lt;/P&gt;
&lt;P&gt;ValueSelected =&amp;nbsp;count(distinct if([FieldSelected]='X',0))&lt;/P&gt;
&lt;P&gt;Variable1 = [MyField1]+[myField2]-[myField3] e.g. [10] + [5] - [1] = 14&lt;/P&gt;
&lt;P&gt;Variable2=&amp;nbsp;Money(Alt(Sum([myField]), 0))&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the user selects a specific value, I need it to go to variable 1, if not, then variable 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I have been trying so far but it hasn't worked:&lt;/P&gt;
&lt;P&gt;=if([ValueSelected] = 1, $(Variable2),$(Variable1))&lt;/P&gt;
&lt;P&gt;How can I do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 21:12:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/different-variable-formula-based-on-a-field-selection/m-p/2110573#M1224479</guid>
      <dc:creator>VC1258</dc:creator>
      <dc:date>2023-08-28T21:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: different variable formula based on a field selection</title>
      <link>https://community.qlik.com/t5/QlikView/different-variable-formula-based-on-a-field-selection/m-p/2110623#M1224481</link>
      <description>&lt;P&gt;Can&amp;nbsp; you elaborate further what is '&lt;SPAN&gt;ValueSelected', is it a filterbox object expression where you are making selection?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Why variable1 fields are not surrounded by aggregation function like you got for variable 2?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 03:41:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/different-variable-formula-based-on-a-field-selection/m-p/2110623#M1224481</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2023-08-29T03:41:35Z</dc:date>
    </item>
  </channel>
</rss>

