Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
tracycrown
Creator III
Creator III

Aggr function not working

Dear all

I managed to compute the average score 53.0 for 5 batches but failed to show the result, please advise urgently.

Thank you so much

Tracy

14 Replies
sunny_talwar

Did you try adding the new dimensions to your Aggr() function when you added them to the dimension?

When only Type is added, try this:

If(Dimensionality() = 0, Aggr(If(avg(TOTAL Score)>= [Lower] and avg(TOTAL Score)<= [Upper], Result), Batch, Result, Type), Aggr(If(avg(Score)>= [Lower] and avg(Score)<= [Upper], Result), Batch, Result, Type))

When Type and Item are added

If(Dimensionality() = 0, Aggr(If(avg(TOTAL Score)>= [Lower] and avg(TOTAL Score)<= [Upper], Result), Batch, Result, Type, Item), Aggr(If(avg(Score)>= [Lower] and avg(Score)<= [Upper], Result), Batch, Result, Type, Item))

When you add a dimension to the chart, you will most likely need to add it to the Aggr() expression also. Check out the attached

Capture.PNG

sunny_talwar

To attach a sample, check out the following link:

Uploading a Sample

tracycrown
Creator III
Creator III
Author

Dear Sunny

Yes, I did add Type and Item in the Aggr() function, please refer to attached files for details.

Thank you, Tracy

sunny_talwar

Here you go, try these expressions:

With Type:

If(Dimensionality() <= 1, Aggr(If(Avg(TOTAL Score) >= [Lower] and avg(TOTAL Score)<= [Upper], Result), Batch, Type, Result), Aggr(If(avg(Score)>= [Lower] and avg(Score)<= [Upper], Result), Batch, Type, Result))

With Type and Item

If(Dimensionality() <= 2, Aggr(If(avg(TOTAL Score)>= [Lower] and avg(TOTAL Score)<= [Upper], Result), Batch, Type, Item, Result), Aggr(If(avg(Score)>= [Lower] and avg(Score)<= [Upper], Result), Batch, Type, Item, Result))

tracycrown
Creator III
Creator III
Author

Dear Sunny

Thank you for your help, please advise what is the meaning of <= 1 or 2.

Tracy