Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
florian_kloster
Creator
Creator

Create ranking sorted ascending with Aggr

Hi all,

I would like to sort the aggregated list ascending. When using the following syntax, it sorts the values but descending. 
Unfortunately, I do not have a clue how to sort it ascending.

(rank({$<OPPORTUNITY_CLOSE_DATE_YEAR={$(vYear_Score)}, OPPORTUNITY_BUSINESS_UNIT={$(vBusiness_Unit)}, OPPORTUNITY_IS_WON={1}, OPPORTUNITY_AGGREGATION_TYPE={$(vType)}>}
sum(
aggr(sum({$<OPPORTUNITY_CLOSE_DATE_YEAR={$(vYear_Score)}, OPPORTUNITY_BUSINESS_UNIT={$(vBusiness_Unit)}, OPPORTUNITY_IS_WON={1}, OPPORTUNITY_AGGREGATION_TYPE={$(vType)}>} PRODUCT_OFFERING_SALES_PRICE),
AGGREGATION_IDENTIFIER, OPPORTUNITY_ACCOUNT_ID, OPPORTUNITY_OWNER_NAME)*AGGREGATION_WEIGHTING_POSTAL_CODE), 1))


Question:
Can you show my how to change the syntax to be in ascending order?

Thank you very much!!

Labels (3)
1 Reply
mato32188
Specialist
Specialist

Hi @florian_kloster ,

if you put minus sign (-) before rank function, does it help? Like

-(rank({$<OPPORTUNITY_CLOSE_DATE_YEAR={$(vYear_Score)}, OPPORTUNITY_BUSINESS_UNIT={$(vBusiness_Unit)}, OPPORTUNITY_IS_WON={1}, OPPORTUNITY_AGGREGATION_TYPE={$(vType)}>}
sum(
aggr(sum......

br

m

ECG line chart is the most important visualization in your life.