<?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 Setting result of IF statement to dimension in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Setting-result-of-IF-statement-to-dimension/m-p/2051527#M86434</link>
    <description>&lt;P&gt;New to Qlik and have a question on storing the outputs of an if statement to a custom dimension to be used in charts.&lt;/P&gt;
&lt;P&gt;Basically, what I want to do is something like this:&lt;/P&gt;
&lt;P&gt;if([date] &amp;gt; Today, 'Future', 'Past')&lt;/P&gt;
&lt;P&gt;Then be able to say if [CustomDimension] = 'Future', do something (count the number of records returned, custom coloring, etc)&lt;/P&gt;
&lt;P&gt;How do I save the if statements value to a custom dimension to use elsewhere without having to reuse the if statement?&lt;/P&gt;</description>
    <pubDate>Tue, 21 Mar 2023 12:08:51 GMT</pubDate>
    <dc:creator>Evan0211</dc:creator>
    <dc:date>2023-03-21T12:08:51Z</dc:date>
    <item>
      <title>Setting result of IF statement to dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Setting-result-of-IF-statement-to-dimension/m-p/2051527#M86434</link>
      <description>&lt;P&gt;New to Qlik and have a question on storing the outputs of an if statement to a custom dimension to be used in charts.&lt;/P&gt;
&lt;P&gt;Basically, what I want to do is something like this:&lt;/P&gt;
&lt;P&gt;if([date] &amp;gt; Today, 'Future', 'Past')&lt;/P&gt;
&lt;P&gt;Then be able to say if [CustomDimension] = 'Future', do something (count the number of records returned, custom coloring, etc)&lt;/P&gt;
&lt;P&gt;How do I save the if statements value to a custom dimension to use elsewhere without having to reuse the if statement?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 12:08:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Setting-result-of-IF-statement-to-dimension/m-p/2051527#M86434</guid>
      <dc:creator>Evan0211</dc:creator>
      <dc:date>2023-03-21T12:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Setting result of IF statement to dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Setting-result-of-IF-statement-to-dimension/m-p/2051531#M86436</link>
      <description>&lt;P&gt;You would typically add this as a field in your load script, making it easily reusable across the entire app.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 12:26:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Setting-result-of-IF-statement-to-dimension/m-p/2051531#M86436</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2023-03-21T12:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Setting result of IF statement to dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Setting-result-of-IF-statement-to-dimension/m-p/2051540#M86437</link>
      <description>&lt;P&gt;I did the following:&lt;/P&gt;
&lt;P&gt;SET _DateCheck =&amp;nbsp;&lt;SPAN&gt;if([date] &amp;gt; Today, 'Future', 'Past');&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And then I set a pie chart to _DateCheck and did the measure as a Count([ID]).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now, I want to do a custom color on the pie chart like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Custom Color Expression: If(_DateCheck = 'Future', Blue(), Red())&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;but it is changing the entire pie chart to Red()&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have also tried&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If(Pick(_DateCheck&amp;nbsp;, 'Future'), Blue(), Red()) but it still colors the entire pie chart red instead of just the past slice.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 12:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Setting-result-of-IF-statement-to-dimension/m-p/2051540#M86437</guid>
      <dc:creator>Evan0211</dc:creator>
      <dc:date>2023-03-21T12:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Setting result of IF statement to dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Setting-result-of-IF-statement-to-dimension/m-p/2051552#M86439</link>
      <description>&lt;P&gt;Set creates a variable, not a field, and it does not evaluate the expression (you would need Let for that). You also incorrectly used Today instead of Today(). &lt;/P&gt;
&lt;P&gt;You would typically do this as a field in the load statement, e.g.&lt;/P&gt;
&lt;P&gt;Load Date, if(Date &amp;gt; Today(), 'Future','Past') as isFuture, SomeOtherField&lt;/P&gt;
&lt;P&gt;From SomeTable;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 12:50:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Setting-result-of-IF-statement-to-dimension/m-p/2051552#M86439</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2023-03-21T12:50:54Z</dc:date>
    </item>
  </channel>
</rss>

