Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem in the sequence of Calendar Quarter Year.

Hi All,

I have a field in my Calendar Table in DB which contains a field related to  Calendar and stored into a QVD called Calendar. I am using  Year and Quarter fields from the QVD to get Quarter Year( eg: Q1/2014,Q2/2014,Q3/2014 etc). In the chart this field is not getting displayed in sequence. Attaching the screen shot. Please suggest me how to sort this. I have tried few ways and nothing was working.

CalendarQuarter.PNG.png

Please help.

Thanks,

Saritha Xavier

17 Replies
Not applicable
Author

Hi,

Am  attaching a sample file with the calendar field i require. a list box is there with Quarter year

MarcoWedel

Hi,

this way sorting and date calculations are possible out-of-the-box:

LOAD Dual(Quarter, MakeDate(Right(Quarter, 4), Mid(Quarter,2,1)*3-2, 1)) as Quarter,

    Ceil(Rand()*100) as value

Inline [

Quarter

Q1/2012

Q2/2012

Q3/2012

Q4/2012

Q1/2013

Q2/2013

Q3/2013

Q4/2013

Q1/2014

Q2/2014

Q3/2014

];

QlikCommunity_Thread_131391_Pic1.JPG.jpg

QlikCommunity_Thread_131391_Pic2.JPG.jpg

hope this helps

regards

Marco

sundarakumar
Specialist II
Specialist II

PFA the applciation with fix for the sort issue,

-Sundar

MarcoWedel

QlikCommunity_Thread_131391_Pic3.JPG.jpg

regards

Marco

ashfaq_haseeb
Champion III
Champion III

Hi,

Have a look to attached modified application.

Marco Solution work like a charm and its easiest to implement.

Regards

ASHFAQ

engishfaque
Specialist III
Specialist III

Dear Saritha,

Use this one, for quick solution.

'Q' & Ceil(Month(TO_DATE)/3) AS CalendarQuarter

Kind regards,

Ishfaque Ahmed

Not applicable
Author

thanks a lot Marko..this solved my problem...

thanks to all who gave me hepful answers

Not applicable
Author

Hi Marco,

I am having same problem while using below script as well...

'Q' & Ceil(Month(Date#(DISCHARGE_DT,'MM/DD/YYYY'))/3)  & ' ' & Year(Date#(DISCHARGE_DT,'MM/DD/YYYY'))) AS O_CalendarQuarter