Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
My first dimension is “Customer Name”, my second dimension is “Month” and my values/expression are sales values. I want my table to sort the customers descending by their respective sales values (Qlik Sense does that already), but if I expand the customer dimension to see the sales per customer per month, I would like that sorted from January to December.
This does not work. Instead, Qlik Sense sorts the months also by sales figures (per customer per month) in a descending order.
Example:
| Customer | Sum(Sales) |
| Customer B | 1,000 |
| Feb | 700 |
| Mar | 200 |
| Jan | 100 |
| Customer D | 800 |
| Jan | 400 |
| Mar | 300 |
| Feb | 100 |
But I want it to be:
| Customer | Sum(Sales) |
| Customer B | 1,000 |
| Jan | 100 |
| Feb | 700 |
| Mar | 200 |
| Customer D | 800 |
| Jan | 400 |
| Feb | 100 |
| Mar |
300 |
@Mohan23912391 use sort by measure option for Month field and put below expression
=match(Only({1}Month),'Jan','Feb','Mar','Apr','May','Jun','July'....)
@Mohan23912391 use sort by measure option for Month field and put below expression
=match(Only({1}Month),'Jan','Feb','Mar','Apr','May','Jun','July'....)
In continuation to above, I have another scenario
| Customer | Sum(Sales) |
| Customer B | 1,000 |
| Feb | 700 |
| Mar | 200 |
| Jan | 100 |
| Customer D | 800 |
| Jan | 400 |
| Mar | 300 |
| Feb | 100 |
I want output like below
| Customer | Sum(Sales) |
| Customer D | 800 |
| Jan | 400 |
| Mar | 300 |
| Feb |
100 |
| Customer B |
1,000 |
| Feb |
700 |
| Mar |
200 |
| Jan |
100 |
- customer values should be in a fixed order that I define (there are 20 customers and I define the order)
- 2nd dimension(Month) should be sorted as per Sum(sales) in descending order
How to get this.
I have set customer_sort_field in 1st dimension's sorting, then have put sum(sales) in 2nd dimension's sorting order.
But it's not working
@Mohan23912391 In this case you won't be able to sort it by expression for Month . You need to create calculated dimension for Month using dual then sort Month Numerically descending
=dual(Month, aggr(sum(aggr(NODISTINCT rank(Customer,4,1),Month)*1e5)+sum(Sales), Customer,Month))