Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Sorting of month.year

Hello Everyone,

Can someone urgently help me in resolving this issue:

I have created my 'month.year' field in my script using the below line:

Load:

month(subfield([date], ' ' ,1)) &' '& Year(subfield([date], ' ' ,1)) as monthyear,

and it works perfectly.

However, when i create a bar chart with it, I do not manage to sort the date correctly.sort fail.PNG

I tried to sort it in all possible ways in the ''Chart Properties tab Sort'' but nothing works.

Thanks,

Hasvine

1 Solution

Accepted Solutions
Highlighted
Creator II
Creator II

HI

Try using MonthName(date) As MonthYear,

instead of

month(subfield([date], ' ' ,1)) &' '& Year(subfield([date], ' ' ,1)) as monthyear,

in the Load then try sorting

View solution in original post

6 Replies
Highlighted

Try Dual function

How to use- Dual()

Highlighted
Not applicable

Hi but unfortunately it is not working.I do not know if I am writing it correctly or not. Could you please give me an example?

Highlighted
Creator II
Creator II

HI

Try using MonthName(date) As MonthYear,

instead of

month(subfield([date], ' ' ,1)) &' '& Year(subfield([date], ' ' ,1)) as monthyear,

in the Load then try sorting

View solution in original post

Highlighted
Not applicable

Hi

In script create resident  master calender table(month year,year,month etc...). order by Date.

EX:

Table:

load field 1,

         ..........

         Date,

from table;

load date,

year(date) as Year,

month(subfield([date], ' ' ,1)) &' '& Year(subfield([date], ' ' ,1)) as monthyear,

......

....

resident table

order by Date;



Regards,

Chennaiah

Highlighted
Not applicable

Thanks Guys..It works now and I just finish my project.

Highlighted
Contributor
Contributor

The easy solution is to use the function with Month and Year field  and use it in the sorting expression.

 

=MakeDate(Year, Month)