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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
sifatnabil
Specialist
Specialist

Rank of a customer in a chart with date as dimension

Hi all,

I have a chart with date as dimension, and in expression, I want to display the rank of a customer (e.g. X) in terms of the number of orders placed. The end result should look like this chart:

    

DateTotal ordersOrders from XOrder rank of X
10/08/20162152

where Total orders: count(distinct Id)

How can I display this?

1 Solution

Accepted Solutions
sunny_talwar

My bad, I put Order by mistake in the Aggr() function, I wanted to do this;

Only({<Customer = {'X'}>}Aggr(Rank(Count({1}DISTINCT Id), Customer, Date))

View solution in original post

7 Replies
sunny_talwar

May be like this:

Only({<Customer = {'X'}>}Aggr(Rank(Count({1}DISTINCT Id), Customer, Order))

sifatnabil
Specialist
Specialist
Author

Hi stalwar1‌, I tried this:

Only({<Customer={'X'}>}Aggr(Rank(Count(DISTINCT Id)),Customer, Id)) but getting values like "1-31". Any ideas? Thanks.

sunny_talwar

Is there a reason you did not add Date in the Aggr() function?

sifatnabil
Specialist
Specialist
Author

That worked! Cheers.

Only({<Customer={'X'}>}Aggr(Rank(Count(DISTINCT Id)),Customer, OrderDate))

sunny_talwar

My bad, I put Order by mistake in the Aggr() function, I wanted to do this;

Only({<Customer = {'X'}>}Aggr(Rank(Count({1}DISTINCT Id), Customer, Date))

sifatnabil
Specialist
Specialist
Author

Hi stalwar1‌, what if there is more than 1 ranking, like "4-5"? Only() returns a null for these ranks I think.

sunny_talwar

How about Concat?

Concat({<Customer = {'X'}>}Aggr(Rank(Count({1}DISTINCT Id), Customer, Date), ', ')