Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with Month - Year Field

Hi,

I need help with this. Im new to qiliview.

I have all a table with all the sales order in 3 years, with the date YYYY-MM-DD of the order.

I want to make a line chart that shows the sum(Sales) by month. So i made a field called Month Year, like this : month(saledate)&' '&year(saledate).

Everything oK... but when i want to sort it to show it in the chart the sort doesent work correctly.

I try to put expressiones, sort in load order, and nothing.

The sort i get is something like this.. : dic 2007 - jun 2007 - mar 2008 ... etc...

I try order by expression Year(..) & month(...) but nothing.

Alwayes there is a month-year that is not correctly order....

What can i dot??

Thanks!!!!!!!1

3 Replies
hector
Specialist
Specialist

Hi, instead of that create the calculated expression

date(saledate,'MM-YYYY')


and sort by numeric value

OR

use dual

dual(month(saledate) & '-' year(saledate), year(saledate)*100 + month(saledate))


so the text will be 'Jan-2011', but the internal value will be 201101, and use numeric value for the sort

Rgds

Not applicable
Author

hi,

Use the monthname function to craete the MonthYear field:

Monthname(saledate) as MonthYear

then you just have to order your MonthYear field by Numeric Value

hope this helps

Not applicable
Author

Thanks!!! Problem solved!