Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

I need my values in descending order

Dear All,

I have one date field(Ldate) ,that i need to split into three i.e(LdateA, LdateB, LdateC)


My requirement is above three date field values should be in descending order.

For example- if i select any value in Ldate(20-08-2014) the corresponding values for four date value should be like this..(LdateA-21.08.2014, LdateB-22.08.2014, and LdateC-23.08.2014).

But in my case it is not showing in an order..For example----(LdateA-21.08.2014, LdateB-23.08.2014, and LdateC-22.08.2014).

I'm acheiving the above three dates from Ldate by using the below functions:

subfield(concat(DISTINCT(Ldate),',',Ldate),',',1) AS LdateA ,

subfield(concat(DISTINCT(Ldate),',',Ldate),',',2) AS LdateB ,

subfield(concat(DISTINCT(Ldate),',',Ldate),',',3) AS LdateC ,

Thanks in advance..

2 Replies
Not applicable
Author

Hi Logesh,

Where are you trying to do this(in script or in chart/table)?

If possible, please attach sample qvw.

Thanks

Sabal

Anonymous
Not applicable
Author


if you are just adding a day to the date, you can simply do it using the following:

Load

Ldate,

Date(Ldate+1) as LdateA,

Date(Ldate+2) as LdateB,

Date(Ldate+3) as LdateC,

...

from ...

;

make sure your DateFormat, TimeStampFormat and the dates you use are in the same format - for example, if your date is 20-08-2014, then DateFormat should be set as 'D-M-YYYY' and not 'D/M/YYYY'. otherwise, the above expressions won't work.