Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
apoorvasd
Creator II
Creator II

Aggr function within a sum function

Hello Everyone,

I am using aggr function within sum function as shown in the below expression. The problem is, since I am using "if" statement, the bar chart some how doesn't display the data until I choose a value in field, "F1". After using aggr function this problem is eliminated and the graph displays value even without making a selection in "F1". But now when I choose one particular week, data displayed is right, but if I choose more than one week, expression sums up for both the weeks and displays it as just one bar as shown in the below screenshot. I would want to see % values for how many ever weeks I choose. So here when I choose week1 and week2, % values for both the weeks should be visible in the graph. How do I do this?

Expression:

=(sum(aggr(if(F1='ONLine',sum({$<F1={"ONLine"},Station={"BMM"}>}"Operating Time ")/sum({$<F1={"ONLine"},Station={"BMM"}>}"Planned Prod. Time "),

if(F1='OFFLine',sum({$<F1={"OFFLine"}>}"Operating Time ")/sum({$<F1={"OFFLine"}>}"Planned Prod. Time ")

*sum({$<F1={"OFFLine"}>}"Planned Prod. Time "))/sum({$<Station={"BMM","Assembly","Welding"},F1={"OFFLine"}>} "Planned Prod. Time ")

)*sum({$<Station={"BMM"}>}"Planned Prod. Time ")/sum({$<Station={"BMM"},Product=,F1=>}TOTAL "Planned Prod. Time "),F1,Line)))

Two weeks.PNG

One week.PNG

Any suggestion?

Thank you.

12 Replies
apoorvasd
Creator II
Creator II
Author

Hi Sunny,

Yes, it works!   Could you please explain what this first "IF" condition here about dimensionality does here?

Thank you.

sunny_talwar

Check here to see how dimensionality works

How to use - Dimensionality()

apoorvasd
Creator II
Creator II
Author

Sure. Thanks!