How can I convert a date field to Quarter in Qlikview?

qlikview

#1

Hi,

I have a date field in backend table, Now I want to create a new dimension “Quarter” so that at front end, user can access quarter wise performance metrics. Please help me to populate this new dimension. Similarly can I also create variables for first half and second half of the year as H1 and H2?

Thanks,
Manuel


#2

@Manuel,

You can use conditional statement (IF) in Edit script to create new variable Quarter. See below code, here I have created quarter using month variable.

  Month,     
    if (Month > 9,'Q4',
	     if(Month>6 ,'Q3',
    		 if(Month>3,'Q2',
			     'Q1'))) 
    as Quarter,
     Sales, 

Regards,
Satish