<?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: Using multi-conditional IF statement with variable to format values in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-multi-conditional-IF-statement-with-variable-to-format/m-p/2058282#M86912</link>
    <description>&lt;P&gt;Hi, maybe it's because you need to add simple quotes: '&lt;SPAN&gt;$(=vMetricType)'='Sales'&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2023 08:19:21 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2023-04-07T08:19:21Z</dc:date>
    <item>
      <title>Using multi-conditional IF statement with variable to format values</title>
      <link>https://community.qlik.com/t5/App-Development/Using-multi-conditional-IF-statement-with-variable-to-format/m-p/2058080#M86899</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am new to Qlik, but I have scoured the interweb on this one and cannot find an answer.&amp;nbsp; I have an app where I want to format the values as either money or a number based on the selection of the user.&amp;nbsp; I am using various variables and also have a variable input item used to switch between Sales and Items (hence the need to switch formats).&amp;nbsp; The issue I am running into is that I want to use the selection of the user in that variable input to decide what format to start with, then use the value to determine whether I display converted to 'K' or 'M'.&lt;/P&gt;
&lt;P&gt;I have put my calculation below, but what happens when I uncomment the part of the If statement that uses the metric value is that I get an 'OK' from the script validation tool, but a return of 0 results.&amp;nbsp; It does not seem to want to use my variable without some sort of aggregation.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help here would be much appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if(&lt;/P&gt;
&lt;P&gt;// $(=vMetricType)=Sales and&lt;BR /&gt;&lt;BR /&gt;sum({&amp;lt;InvoiceDate = {"&amp;gt;=$(vCurrentYear_FirstDate) &amp;lt;=$(vCurrentDate_MaxDate)"}&amp;gt;}$(vMetricType))&amp;gt;=1000000,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;NUM(sum({&amp;lt;InvoiceDate = {"&amp;gt;=$(vCurrentYear_FirstDate) &amp;lt;=$(vCurrentDate_MaxDate)"}&amp;gt;}$(vMetricType))/1000000,'$#,##0.##M;-$#,##0.##M'),&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NUM(sum({&amp;lt;InvoiceDate = {"&amp;gt;=$(vCurrentYear_FirstDate) &amp;lt;=$(vCurrentDate_MaxDate)"}&amp;gt;}$(vMetricType))/1000,'$#,##0.##K;-$#,##0.##K'))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 16:32:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-multi-conditional-IF-statement-with-variable-to-format/m-p/2058080#M86899</guid>
      <dc:creator>Josimpkins</dc:creator>
      <dc:date>2023-04-06T16:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using multi-conditional IF statement with variable to format values</title>
      <link>https://community.qlik.com/t5/App-Development/Using-multi-conditional-IF-statement-with-variable-to-format/m-p/2058282#M86912</link>
      <description>&lt;P&gt;Hi, maybe it's because you need to add simple quotes: '&lt;SPAN&gt;$(=vMetricType)'='Sales'&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 08:19:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-multi-conditional-IF-statement-with-variable-to-format/m-p/2058282#M86912</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2023-04-07T08:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using multi-conditional IF statement with variable to format values</title>
      <link>https://community.qlik.com/t5/App-Development/Using-multi-conditional-IF-statement-with-variable-to-format/m-p/2058411#M86918</link>
      <description>&lt;P&gt;That did it!&amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 16:17:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-multi-conditional-IF-statement-with-variable-to-format/m-p/2058411#M86918</guid>
      <dc:creator>Josimpkins</dc:creator>
      <dc:date>2023-04-07T16:17:50Z</dc:date>
    </item>
  </channel>
</rss>

