<?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(GetSelectedCount) Not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/IF-GetSelectedCount-Not-working/m-p/1590651#M738326</link>
    <description>&lt;P&gt;I'm building a chart with a group dimension (Entity -&amp;gt; Dept - &amp;gt;Provider)&lt;/P&gt;&lt;P&gt;My expression is a little complicated.&lt;/P&gt;&lt;P&gt;Sum(AGGR(Count{&amp;lt;ActiveFLG = {'1'}&amp;gt;}Patients)/Count({&amp;lt;ActiveFLG ={'0', '1'}&amp;gt;}Patients)), Level1, Level2, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({&amp;lt;ActvieFLG = {'1'}&amp;gt;} Distinct Level2Response), Level1, Level2, YearNBR, MonthabbreviatedNM)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now since I have different levels in my chart because of the group dimension I need to rework my expression to include the Entity, Dept, and Provider in the AGGR depending on the level I go to.&lt;/P&gt;&lt;P&gt;So I created an IF statement:&lt;/P&gt;&lt;P&gt;IF(GetSelectedCount(Level1)&amp;gt;=1,Sum(AGGR(Count{&amp;lt;ActiveFLG = {'1'}&amp;gt;}Patients)/Count({&amp;lt;ActiveFLG ={'0', '1'}&amp;gt;}Patients)), Level1, Level2, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({&amp;lt;ActvieFLG = {'1'}&amp;gt;} Distinct Level2Response), Level1, Level2, YearNBR, MonthabbreviatedNM)))&lt;/P&gt;&lt;P&gt;,IF(GetSelectedCount(Entity)&amp;gt;=1,Sum(AGGR(Count{&amp;lt;ActiveFLG = {'1'}&amp;gt;}Patients)/Count({&amp;lt;ActiveFLG ={'0', '1'}&amp;gt;}Patients)), Level1, Level2, Entity, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({&amp;lt;ActvieFLG = {'1'}&amp;gt;} Distinct Level2Response), Level1, Level2, Entity,&amp;nbsp; YearNBR, MonthabbreviatedNM)))&lt;/P&gt;&lt;P&gt;,IF(GetSelectedCount(Dept)&amp;gt;=1,Sum(AGGR(Count{&amp;lt;ActiveFLG = {'1'}&amp;gt;}Patients)/Count({&amp;lt;ActiveFLG ={'0', '1'}&amp;gt;}Patients)), Level1, Level2, Entity, Dept, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({&amp;lt;ActvieFLG = {'1'}&amp;gt;} Distinct Level2Response), Level1, Level2, Entity, Dept, YearNBR, MonthabbreviatedNM)))&lt;/P&gt;&lt;P&gt;,IF(GetSelectedCount(Provider)&amp;gt;=1,Sum(AGGR(Count{&amp;lt;ActiveFLG = {'1'}&amp;gt;}Patients)/Count({&amp;lt;ActiveFLG ={'0', '1'}&amp;gt;}Patients)), Level1, Level2, Entity, Dept,Provider, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({&amp;lt;ActvieFLG = {'1'}&amp;gt;} Distinct Level2Response), Level1, Level2, Entity, Dept,Provider, YearNBR, MonthabbreviatedNM))))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this expression is not working at all.&amp;nbsp; Basically if a provider is selected then I need it to follow that logic provided above and so on.&amp;nbsp; Now the logic works if I only have one IF statement but doesnt supply me with the correct answer when I add a second IF statement.&amp;nbsp; So I think I'm doing something incorrectly with my IF statement.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 20:41:23 GMT</pubDate>
    <dc:creator>kaylaramsey2</dc:creator>
    <dc:date>2024-11-16T20:41:23Z</dc:date>
    <item>
      <title>IF(GetSelectedCount) Not working</title>
      <link>https://community.qlik.com/t5/QlikView/IF-GetSelectedCount-Not-working/m-p/1590651#M738326</link>
      <description>&lt;P&gt;I'm building a chart with a group dimension (Entity -&amp;gt; Dept - &amp;gt;Provider)&lt;/P&gt;&lt;P&gt;My expression is a little complicated.&lt;/P&gt;&lt;P&gt;Sum(AGGR(Count{&amp;lt;ActiveFLG = {'1'}&amp;gt;}Patients)/Count({&amp;lt;ActiveFLG ={'0', '1'}&amp;gt;}Patients)), Level1, Level2, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({&amp;lt;ActvieFLG = {'1'}&amp;gt;} Distinct Level2Response), Level1, Level2, YearNBR, MonthabbreviatedNM)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now since I have different levels in my chart because of the group dimension I need to rework my expression to include the Entity, Dept, and Provider in the AGGR depending on the level I go to.&lt;/P&gt;&lt;P&gt;So I created an IF statement:&lt;/P&gt;&lt;P&gt;IF(GetSelectedCount(Level1)&amp;gt;=1,Sum(AGGR(Count{&amp;lt;ActiveFLG = {'1'}&amp;gt;}Patients)/Count({&amp;lt;ActiveFLG ={'0', '1'}&amp;gt;}Patients)), Level1, Level2, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({&amp;lt;ActvieFLG = {'1'}&amp;gt;} Distinct Level2Response), Level1, Level2, YearNBR, MonthabbreviatedNM)))&lt;/P&gt;&lt;P&gt;,IF(GetSelectedCount(Entity)&amp;gt;=1,Sum(AGGR(Count{&amp;lt;ActiveFLG = {'1'}&amp;gt;}Patients)/Count({&amp;lt;ActiveFLG ={'0', '1'}&amp;gt;}Patients)), Level1, Level2, Entity, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({&amp;lt;ActvieFLG = {'1'}&amp;gt;} Distinct Level2Response), Level1, Level2, Entity,&amp;nbsp; YearNBR, MonthabbreviatedNM)))&lt;/P&gt;&lt;P&gt;,IF(GetSelectedCount(Dept)&amp;gt;=1,Sum(AGGR(Count{&amp;lt;ActiveFLG = {'1'}&amp;gt;}Patients)/Count({&amp;lt;ActiveFLG ={'0', '1'}&amp;gt;}Patients)), Level1, Level2, Entity, Dept, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({&amp;lt;ActvieFLG = {'1'}&amp;gt;} Distinct Level2Response), Level1, Level2, Entity, Dept, YearNBR, MonthabbreviatedNM)))&lt;/P&gt;&lt;P&gt;,IF(GetSelectedCount(Provider)&amp;gt;=1,Sum(AGGR(Count{&amp;lt;ActiveFLG = {'1'}&amp;gt;}Patients)/Count({&amp;lt;ActiveFLG ={'0', '1'}&amp;gt;}Patients)), Level1, Level2, Entity, Dept,Provider, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({&amp;lt;ActvieFLG = {'1'}&amp;gt;} Distinct Level2Response), Level1, Level2, Entity, Dept,Provider, YearNBR, MonthabbreviatedNM))))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this expression is not working at all.&amp;nbsp; Basically if a provider is selected then I need it to follow that logic provided above and so on.&amp;nbsp; Now the logic works if I only have one IF statement but doesnt supply me with the correct answer when I add a second IF statement.&amp;nbsp; So I think I'm doing something incorrectly with my IF statement.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:41:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-GetSelectedCount-Not-working/m-p/1590651#M738326</guid>
      <dc:creator>kaylaramsey2</dc:creator>
      <dc:date>2024-11-16T20:41:23Z</dc:date>
    </item>
  </channel>
</rss>

