Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SORTING IN PIVOT TABLE

I have customer wise sales data per month. I have created a pivot table showing Customer Name Vs Monthwise sales.

Also sorted data decreasing manner for total sale per customer.

Data for first few customers shown below....

Customer NameMonthTotalJanFebMarAprMayDec
Total7,569,868866,396917,070904,956660,1911,284,303639,091
Customer 1987,912117,230121,298160,14689,691128,4541,453
Customer 2743,881179,02262,59356,743118,12296,074
Customer 3524,9236,537109,20389,726
Customer 4497,782497,782
Customer 5395,612118,45993,752133,72112,4458,350
Customer 6341,99414,4748,99481,6003,786133,288


My problem is from above table December Month data is for 2010 while January to May months sale is for 2011.

So I need this pivot table should show data as DEC JAN FEB MAR APR MAY...

Please help...

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Are your months defined like this?

month(Date) as Month

If so, that's why they don't sort with the year taken into account.  To include the year, define your months as dates:

date(monthstart(Date),'MMM YYYY') as Month

You don't HAVE to include YYYY there, if you only want to show the month name, but I think it'll be confusing without it.

View solution in original post

4 Replies
its_anandrjs

Hi,

You need to sort your Month Colum by Decending order then the pivot chart automatically display Dec,Jan,Feb,mar,Apr,May by Properties->Sort->Expression->Select Month column then select Descending order.

Regards,

Anand

Not applicable
Author

It's not working

johnw
Champion III
Champion III

Are your months defined like this?

month(Date) as Month

If so, that's why they don't sort with the year taken into account.  To include the year, define your months as dates:

date(monthstart(Date),'MMM YYYY') as Month

You don't HAVE to include YYYY there, if you only want to show the month name, but I think it'll be confusing without it.

Not applicable
Author

Dear John, It's now working... Thanks for your help...