Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sort Months

Hi,

i have 2 fields for months and 2 for years

month1,month2,year1,year2

suppose the user select july from month1 and year1=2013

and select february from month2 and year2=2014

in the chart i'm displaying the sales within this period

i.e the month is the dimension and i have 2 expressions:

1- sum(sales) for the selected period

2-sum(sales) for previous year period (from july 2012 to february 2013)

what i want is to sort the dimension of the month in the chart to be july-august-september-oct-nov-dec-jan-feb

because the chart sort them as jan-feb-july-august-....

So,,How can i sort the dimension?

Thanks in Advance.

7 Replies
Sokkorn
Master
Master

Hi Mona,

Let try to sort dimension by expression. Right click on chart -> Properties -> Sort -> Check on Expression then using

(YearField*100)+Num(MonthField)

Regards,

Sokkorn

Not applicable
Author

Hi Sokkorn,

no not working !

Sokkorn
Master
Master

Hi Mona,

Can you share your app?

Regards,

Sokkorn

abeyphilip
Creator II
Creator II

Hi,

You can also try this in your sort expression and then sort Ascending:

if (month_fld='Jul',1,

if (month_fld='Aug',2,

if (month_fld='Sep',3,

if (month_fld='Oct',4,

if (month_fld='Nov',5,

if (month_fld='Dec',6,

if (month_fld='Jan',7,

if (month_fld='Feb',8))))))))

Regards,

Abey

Not applicable
Author

i have 2 month fields month1,month2 and 2 year fields year1,year2.

Also, the user may select another period next time may select for example from may 2013 to mar 2014 and so on

Anonymous
Not applicable
Author

Hello Mona,

which dimension month are using to plot your chart? Month1, month2 or another one?

ecolomer
Master II
Master II

Here you have an example

Sorry, because my QV is in Spanish.