Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Rank & Aggregation Question

I'm trying to calculate a rank from the Rating column that is aggregated over Date, Time and Location fields.

This is my current table where Rank = rank(TOTAL(Rating),0,1)

DateTimeLocationNameRating
Rank
2017-06-2513:00LondonMatt1234
2017-06-2513:00LondonTim1225
2017-06-2513:00LondonBob1216
2017-06-2415:00LondonFrank1561
2017-06-2415:00LondonJim1422
2017-06-2415:00LondonPat1343

What I need to achieve is:

DateTimeLocationNameRating
Rank
2017-06-2513:00LondonMatt1231
2017-06-2513:00LondonTim1222
2017-06-2513:00LondonBob1213
2017-06-2415:00LondonFrank1561
2017-06-2415:00LondonJim1422
2017-06-2415:00LondonPat1343

I've tried using rank and aggr but just cannot get it to work.

Any help appreciated.

Thanks

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Try this.

Aggr(Rank(Sum(Rating)),Date,Time,Name)

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".

View solution in original post

5 Replies
Highlighted
MVP
MVP

try this

rank(TOTAL <Date> only(Rating),0,1)

Highlighted
Master III
Master III

Hi Matthew,

maybe remove Total from Expression

Regards,

Antonio

Highlighted
MVP & Luminary
MVP & Luminary

Try this.

Aggr(Rank(Sum(Rating)),Date,Time,Name)

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".

View solution in original post

Highlighted
Contributor
Contributor

Thanks, but that returns Rank as 1 for all rows,

Highlighted
Contributor
Contributor

Thanks, that worked