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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
jessica_webb
Creator III
Creator III

Evaluate variable for each dimension value

I have a table with dimension 'Point' (which has four values: One, Two, Three, Four) and expression:

=Num(ONLY({<IsAcad={'-1'}>} Aggr($(vAPS_Current),IsAcad)),'#,##.#')  &' (' & $(vAcadAPS_Grade_Current) & ')'

The variables are:

vAPS_Current = SUM(Current_points)/SUM(Qual_size)

vAcadAPS_Grade_Current =

IF(ONLY({<IsAcad={'-1'}>} Aggr($(vAPS_Current),IsAcad))>=60,'A*',

IF(ONLY({<IsAcad={'-1'}>} Aggr($(vAPS_Current),IsAcad))>=56.67,'A*-',

IF(ONLY({<IsAcad={'-1'}>} Aggr($(vAPS_Current),IsAcad))>=53.34,'A+',

IF(ONLY({<IsAcad={'-1'}>} Aggr($(vAPS_Current),IsAcad))>=50,'A',

IF(ONLY({<IsAcad={'-1'}>} Aggr($(vAPS_Current),IsAcad))>=46.67,'A-',)))))))))))))


All works as I would expect, but it doesn't give the expression value for each dimension value.


So, with all selections cleared I get the following table:

OneTwoThreeFour
EXP:47.9 (A-)()()()

Then, if I select 'Point' Two, I get the following table:

OneTwoThreeFour
EXP:()55 (A+)()()

I don't understand why it isn't evaluating for each dimension value?

Does anyone know what I can do to have all cells filled with the correct value?

1 Solution

Accepted Solutions
uacg0009
Partner - Specialist
Partner - Specialist

Hi Jessica,

Please try to add nodistinct into your aggr function, like aggr(nodistinct .....)

Hope it can help you.

Thanks.

Aiolos

View solution in original post

19 Replies
sunny_talwar

If you use this without the variable (directly in your chart), does it still do the same thing? Or is this only when you use it as a variable?

jessica_webb
Creator III
Creator III
Author

If I remove all the part in red:

Num(ONLY({<IsAcad={'-1'}>} Aggr($(vAPS_Current),IsAcad)),'#,##.#')  &' (' & $(vAcadAPS_Grade_Current) & ')'


Then it evaluates across all dimension values (just incorrectly).


So I guess it's actually an issue with the expression, rather than the variable...

sunny_talwar

Is ONE, TWO, THREE, FOUR (up top) a dimension also? What is it's name? IsAcad or something else?

jessica_webb
Creator III
Creator III
Author

No, One, Two, Three & Four are the values for the dimension 'Point'

Anil_Babu_Samineni

I assume, One , Two, Three .. are the dimension which translate from column to Row. Could be Dual() needed here for measure

=Dual(Num(ONLY({<IsAcad={'-1'}>} Aggr($(vAPS_Current),IsAcad)),'#,##.#')  &' (' & $(vAcadAPS_Grade_Current) & ')', Aggr($(vAPS_Current), IsAcad))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Try this

Num(ONLY({<IsAcad={'-1'}>} Aggr($(vAPS_Current), IsAcad, Point)),'#,##.#')  &' (' & $(vAcadAPS_Grade_Current) & ')'

jessica_webb
Creator III
Creator III
Author

No joy there unfortunately!

That gives me:

OneTwoThreeFour
EXP()()()
jessica_webb
Creator III
Creator III
Author

Thanks for the suggestion Anil. Unfortunately that's not working.

I just get:

OneTwoThreeFour
EXP()()()
sunny_talwar

What do you get for this alone? Anything?

Num(Only({<IsAcad={'-1'}>} Aggr($(vAPS_Current), IsAcad, Point)), '#,##.#')