<?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 If statement won't work in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/If-statement-won-t-work/m-p/1726796#M55396</link>
    <description>&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;I have a problem with a simple if statement that won't work and I just can't seem to figure out what is wrong. I'm saving the calculation to a Master Dimension&lt;/P&gt;&lt;P&gt;My formula is the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;If(count({$&amp;lt;[Opgavestatus (Opgave)]={"LUKKET", "INVALID"},Dato = {'($(vDynMaxDate))'},Datotype = {'OpgaveStatus'}&amp;gt;} Distinct [Opgave_id (Opgave)])/count(distinct([Opgave_id (Opgave)])) &amp;gt; 0,'G1', 'Nej')&lt;/P&gt;&lt;P&gt;So basically what's going on, is that i'm doing a ratio calculation, and then i'm checking whether the result is greater than 0 or not. If the result is greater that 0 it should return the string 'G1' else the string 'Nej'.&lt;/P&gt;&lt;P&gt;I then save this to a Master Dimension I want to use in my app. But when I try to use it in a table for example, it just says 'invalid dimension'.&lt;/P&gt;&lt;P&gt;Can anyone helt me understand what I am doing wrong?&lt;/P&gt;&lt;P&gt;By the way, the actual formula i'm using is a lot longer and has many more nested if statements. I just shortened it a bit to make it easier to explain the problem. The issue is the same whether i used the simple formula above or the long one.&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 01:55:55 GMT</pubDate>
    <dc:creator>w21450</dc:creator>
    <dc:date>2024-11-16T01:55:55Z</dc:date>
    <item>
      <title>If statement won't work</title>
      <link>https://community.qlik.com/t5/App-Development/If-statement-won-t-work/m-p/1726796#M55396</link>
      <description>&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;I have a problem with a simple if statement that won't work and I just can't seem to figure out what is wrong. I'm saving the calculation to a Master Dimension&lt;/P&gt;&lt;P&gt;My formula is the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;If(count({$&amp;lt;[Opgavestatus (Opgave)]={"LUKKET", "INVALID"},Dato = {'($(vDynMaxDate))'},Datotype = {'OpgaveStatus'}&amp;gt;} Distinct [Opgave_id (Opgave)])/count(distinct([Opgave_id (Opgave)])) &amp;gt; 0,'G1', 'Nej')&lt;/P&gt;&lt;P&gt;So basically what's going on, is that i'm doing a ratio calculation, and then i'm checking whether the result is greater than 0 or not. If the result is greater that 0 it should return the string 'G1' else the string 'Nej'.&lt;/P&gt;&lt;P&gt;I then save this to a Master Dimension I want to use in my app. But when I try to use it in a table for example, it just says 'invalid dimension'.&lt;/P&gt;&lt;P&gt;Can anyone helt me understand what I am doing wrong?&lt;/P&gt;&lt;P&gt;By the way, the actual formula i'm using is a lot longer and has many more nested if statements. I just shortened it a bit to make it easier to explain the problem. The issue is the same whether i used the simple formula above or the long one.&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:55:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-statement-won-t-work/m-p/1726796#M55396</guid>
      <dc:creator>w21450</dc:creator>
      <dc:date>2024-11-16T01:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: If statement won't work</title>
      <link>https://community.qlik.com/t5/App-Development/If-statement-won-t-work/m-p/1726816#M55399</link>
      <description>&lt;P&gt;Well, as you are using this in dimension you may need to use aggr function to work it correctly&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If(&lt;STRONG&gt;aggr(&lt;/STRONG&gt;count({$&amp;lt;[Opgavestatus (Opgave)]={"LUKKET", "INVALID"},Dato = {'($(vDynMaxDate))'},Datotype = {'OpgaveStatus'}&amp;gt;} Distinct [Opgave_id (Opgave)])/count(distinct([Opgave_id (Opgave)])) ,&lt;STRONG&gt;YourDimension&lt;/STRONG&gt;)&amp;gt; 0,'G1', 'Nej')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;else use this expression in measure instead&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 13:04:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-statement-won-t-work/m-p/1726816#M55399</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-07-10T13:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: If statement won't work</title>
      <link>https://community.qlik.com/t5/App-Development/If-statement-won-t-work/m-p/1726818#M55401</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can you attach here some data ?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 13:04:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-statement-won-t-work/m-p/1726818#M55401</guid>
      <dc:creator>NitinK7</dc:creator>
      <dc:date>2020-07-10T13:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: If statement won't work</title>
      <link>https://community.qlik.com/t5/App-Development/If-statement-won-t-work/m-p/1728007#M55499</link>
      <description>&lt;P&gt;Thanks a lot. The aggr worked, in order to make the Dimension show the correct groups. I didn't know you needed to use the aggr to do that. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 12:23:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-statement-won-t-work/m-p/1728007#M55499</guid>
      <dc:creator>w21450</dc:creator>
      <dc:date>2020-07-15T12:23:31Z</dc:date>
    </item>
  </channel>
</rss>

