Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting in bar chart

Hi

I am pulling data from oracle database.  Its a date field.  I don't want the entire date, so I am using to_char(Date, 'Mon YY') to extract Month and year.

I am using that in qlikview bar chart.  But I am not able to sort it in Jan to Dec.  Since it is a string am not able to sort.

Any help would be appreciated.

Thanks

1 Solution

Accepted Solutions
Michiel_QV_Fan
Specialist
Specialist

You can create a new date field for your bar chart.

Reload your datefield again and add transformations:

LOAD Date,

    date(date#(month(Date)&' '&year(Date), 'MMM YYYY'), 'MMM YY') as New_date

FROM ..........

Step 1: create month and year from date

Step 2: define the combined date field format by using date#

Step 3: define the conbined date field in the desired format with date

Now Qlikivew will indentify the field [Mon YY] as date and you can sort your bar chart.

date test.png

View solution in original post

4 Replies
Sokkorn
Master
Master

Hi Saaty*,

Let try this in sort expression : =Match(MonthField, $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39)))

Let me know if this one solve your issue.

Regards,

Sokkorn Cheav

jagan
Luminary Alumni
Luminary Alumni

Hi Saaty,

While pulling the data from the database you do ordering by date column.  Then in the chart you set the sort order as "Load Order".

Hope this helps in fixing your issue.

Regards,

Jagan.

Michiel_QV_Fan
Specialist
Specialist

You can create a new date field for your bar chart.

Reload your datefield again and add transformations:

LOAD Date,

    date(date#(month(Date)&' '&year(Date), 'MMM YYYY'), 'MMM YY') as New_date

FROM ..........

Step 1: create month and year from date

Step 2: define the combined date field format by using date#

Step 3: define the conbined date field in the desired format with date

Now Qlikivew will indentify the field [Mon YY] as date and you can sort your bar chart.

date test.png

Not applicable
Author

Thanks guys! It worked