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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Group orders by customers order count

I have a table with orders which contains OrderDate, OrderNumber and CustomerNr

I want a chart similar to the image. The first column should group customers order count. Meaning the first row, 1, should show every customers first order. 2 should show only "2nd orders".

tmpscreen.JPG

The expression i have used so far, as a dimension, is: Aggr(RowNo(), CustomerNr, OrderDate)

However, I cant get it right. As you see, the order isnt correct if you look at the dates. Customer 001015534 have made two orders. The order made 2010-12-10 should be the 1st and the order 2012-05-24 the 2nd. Now its the other way around.

How can I fix this? Is it better to solve in the script and how?

Thanks

3 Replies
whiteline
Master II
Master II

Hi.

I guess that Aggr() function uses LoadOrder for sorting.

Try to order your data by OrderDate in script.

Not applicable
Author

Hi whiteline

I tried this but still the same results.

Not applicable
Author

Any way to solve this in the script instead?