Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Nolgath
Creator
Creator

Rank in aggregated field

Hi,

 

My expression:

((avg({<
mileage={">=$(vMileageFrom)<=$(vMileageTo)"},
country={'FR'},
vehicleStatus={1},
currentPrice_EUR = {"=rank(-currentPrice_EUR) <= $(vPriceRange)"}
>}currentPrice_EUR))/1.20)

 

This is getting me the rank from ALL countries, so if user puts 5 as in bottom 5 prices then it goes and gets them from all country meaning that if the first country is GB then it gets fine but this is FR and since the bottom are GB i get null. But i need ranks to go only inside individual countries. So this will get rank for FR ONLY.

 

Is this even possible? I am breaking my head with this 😕

Labels (3)
4 Replies
Anil_Babu_Samineni


This is getting me the rank from ALL countries, so if user puts 5 as in bottom 5 prices then it goes and gets them from all country meaning that if the first country is GB then it gets fine but this is FR and since the bottom are GB i get null. But i need ranks to go only inside individual countries. So this will get rank for FR ONLY.


Not sure I followed the bold part?

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
Nolgath
Creator
Creator
Author

It accounts for all countries, so if the lowest value is of country 'GB' and my expression looks for 'FR' it will be null because those lower are associated to GB, basicly rank is doing rank for all selected fields not only for FR. What I need is to look for rank only in country='FR'

Anil_Babu_Samineni

@Nolgath Does it mean the bold one below not working as it should?

((avg({<
mileage={">=$(vMileageFrom)<=$(vMileageTo)"},
country={'FR'},
vehicleStatus={1},
currentPrice_EUR = {"=rank(-currentPrice_EUR) <= $(vPriceRange)"}
>}currentPrice_EUR))/1.20)

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
Nolgath
Creator
Creator
Author

Correct,

It not only counting for FR, it's only when it finds FR. Kinda of strange.. I am thinking maybe I need to make separate fields for each country and use those instead.. not sure