Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

IF(GetSelectedCount) Not working

I'm building a chart with a group dimension (Entity -> Dept - >Provider)

My expression is a little complicated.

Sum(AGGR(Count{<ActiveFLG = {'1'}>}Patients)/Count({<ActiveFLG ={'0', '1'}>}Patients)), Level1, Level2, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({<ActvieFLG = {'1'}>} Distinct Level2Response), Level1, Level2, YearNBR, MonthabbreviatedNM)))

 

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.

So I created an IF statement:

IF(GetSelectedCount(Level1)>=1,Sum(AGGR(Count{<ActiveFLG = {'1'}>}Patients)/Count({<ActiveFLG ={'0', '1'}>}Patients)), Level1, Level2, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({<ActvieFLG = {'1'}>} Distinct Level2Response), Level1, Level2, YearNBR, MonthabbreviatedNM)))

,IF(GetSelectedCount(Entity)>=1,Sum(AGGR(Count{<ActiveFLG = {'1'}>}Patients)/Count({<ActiveFLG ={'0', '1'}>}Patients)), Level1, Level2, Entity, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({<ActvieFLG = {'1'}>} Distinct Level2Response), Level1, Level2, Entity,  YearNBR, MonthabbreviatedNM)))

,IF(GetSelectedCount(Dept)>=1,Sum(AGGR(Count{<ActiveFLG = {'1'}>}Patients)/Count({<ActiveFLG ={'0', '1'}>}Patients)), Level1, Level2, Entity, Dept, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({<ActvieFLG = {'1'}>} Distinct Level2Response), Level1, Level2, Entity, Dept, YearNBR, MonthabbreviatedNM)))

,IF(GetSelectedCount(Provider)>=1,Sum(AGGR(Count{<ActiveFLG = {'1'}>}Patients)/Count({<ActiveFLG ={'0', '1'}>}Patients)), Level1, Level2, Entity, Dept,Provider, YearNBR, MonthabbreviatedNM))/(Sum(AGGR(Count({<ActvieFLG = {'1'}>} Distinct Level2Response), Level1, Level2, Entity, Dept,Provider, YearNBR, MonthabbreviatedNM))))))

 

However, this expression is not working at all.  Basically if a provider is selected then I need it to follow that logic provided above and so on.  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.  So I think I'm doing something incorrectly with my IF statement.

Labels (3)
0 Replies