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

How to sort date in a chart?

Hi

I have a line chart in my dashboard, it contains date like Jan-11,Feb-10.....

I am not able to sort the dates. I want the dates to be look like Dec - 12, Jan - 13, Feb - 13,.............

Thanks,

16 Replies
Agis-Kalogiannis
Employee
Employee

Hi Faisal

I am sending you a sample qvw file which solves your problem.

What I did, I first created a sample table with the same format as your month-year fields.

Then I resident loaded these values and converted the values to dates.

After that, I created a table box with the monthyear field and as you can see they are sorted by date, exactly as you want.

The most important thing here is the following:

date#(MonthYear, 'MMM - YY') AS MonthYear

(The 'MMM - YY' mus have exactly the same format as your original text monthyear field)

I hope this helps

Agis

Anonymous
Not applicable
Author

Yes I have follwoed these steps, it changed the sorting but NOT in correct order.

Capture21.PNG

Capture22.PNG

qv_testing
Specialist II
Specialist II

Once you try with simple LoadOrder Option....in sot tab

its_anandrjs

Hi,

I suggested for particular field in the load script suppose there is a date field with data as you say i believe it is not in the date format it is text

    Dec- 12

    Jan - 13

    Feb - 13

    Mar - 13

Then you have to create that field into date format for (MMM - YY) also maintain the current format

Load

Date#(date,'MMM - YY') as MonthYear

From Location;

And you get month year as

MonthYr.png

Regards

Anand

Anonymous
Not applicable
Author

There are other ways of doing this but I would need a bit more information about how these dates are loaded in your script.

Agis-Kalogiannis
Employee
Employee

Could you check the answers and close the discussion by selecting the Correct/Helpful answers Faisal?

This will help other people use this as a reference.

Thanks

Agis

MK_QSL
MVP
MVP

I gave the same answer long time ago !