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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
akidhossain
Contributor
Contributor

FirstSortedValue() - "Error in Calculated Dimension"

Hello! 

 

I am trying to use the FirstSortedValue() function to return a Stage of a SKU based on rankings of the Stage. The following is what I have tried for my calculated dimension:

(1) FirstSortedValue([Stage],[Stage Ranking])  ------> Error in Calculated Dimension


(2)  FirstSortedValue(AGGR([Stage],[SKU]),[Stage Ranking])  ------> Error in Calculated Dimension

Also to note: I have confirmed the the field [Stage Ranking] is in NUM format.

Any feedback on what I may be doing wrong? Thank you! 

Labels (1)
3 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Brett_Bleess
Former Employee
Former Employee

Just a couple of other links for you that might be helpful:

https://community.qlik.com/t5/Qlik-Design-Blog/Pitfalls-of-the-Aggr-function/ba-p/1463275

https://community.qlik.com/t5/Qlik-Design-Blog/Don-t-get-aggr-avated-using-aggr/ba-p/1464136

Not sure they will really help, but worth a read.

Cheers,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It sounds like you want to do this calc over SKU, so I believe a calculated dim would be:

Aggr(FirstSortedValue([Stage],[Stage Ranking]), SKU)

-Rob