Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Sathvik
Partner - Contributor II
Partner - Contributor II

Rank Function for a measure based on 2 different dimensions and aggregating on one

Hi All,

I have been working on Ranking a product, what is the rank of the product individual city level when compared to its competitor product.

Rank(aggr(Sum({<Flag={'Product-A'}>}Sales),Month, X, city))

Here, X = Our Company + Competitor Companies (Club)

when the above formula is applied the aggregation is happening on all cities and not on X which is failing the purpose of the use case where I want to see the Ranks of X at each city.

Please let me know how can I achieve this.

Thanks in advance.!

 

 

Labels (1)
3 Replies
TauseefKhan
Creator III
Creator III

Check with This:

Rank(aggr(Sum({<Flag={'Product-A'}>} Sales), City, X))


Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.

Sathvik
Partner - Contributor II
Partner - Contributor II
Author

Hi @TauseefKhan 

Thank you for the response, I have tried this response as well but it is still getting aggregated on City.

TauseefKhan
Creator III
Creator III

Check This:

Rank(aggr(Sum({<Flag={'Product-A'}>} Sales), Dual(ProductName & ' - ' & City, ProductName, City, X)))