Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi..
i am new to qlikview ,trying to define quarter using the below script is any limitation in doing this ways,
'Q' & CEIL(MONTH(DATE(DATE#((left(Cdate,6)),'DDMMYY'),'DD-MM-YYYY'))/3) AS QUATER
Thanking You
Vianyagam
Yes. This would be a simply text representation of your quarters which would not respond to qlikview date functions. For ex: if you try to use AddMonths() function to a generated value Q1, would not get desired output. This is because, here Q1 is just a text. However, if you create quarters using QuarterName(), you get a value with underlaying numeric/date values. And those values (would look like - 'Oct-Dec 2013') respond to other date functions (like AddMonths()) to produce desired output.
Note: If you are bothered about the presentation (prefer- 'Q4' over 'Oct-Dec 2005'), you might think of using Dual() and enjoy both the facilities.
Looks like you have (may be) timestamp ....
you can also use FLOOR function to get Date from TimeStamp...
Try as below in text box
='Q' & CEIL(MONTH(Date(FLOOR(NOW())))/3)
'Q' & Ceil(Mid(Cdate,3,2)/3)
Yes. This would be a simply text representation of your quarters which would not respond to qlikview date functions. For ex: if you try to use AddMonths() function to a generated value Q1, would not get desired output. This is because, here Q1 is just a text. However, if you create quarters using QuarterName(), you get a value with underlaying numeric/date values. And those values (would look like - 'Oct-Dec 2013') respond to other date functions (like AddMonths()) to produce desired output.
Note: If you are bothered about the presentation (prefer- 'Q4' over 'Oct-Dec 2005'), you might think of using Dual() and enjoy both the facilities.
Update new change
NO error in the script you can use it it self or may be
'Q' & CEIL(MONTH(DATE(DATE#((left(Cdate,6)),'DDMMYY'),'DD-MM-YYYY'))/3) AS QUATER
Or
Try like
='Q' & CEIL(MONTH(DATE#(Mid(Cdate,3,2),'MM'))/3)
Ex:-
='Q' & CEIL(MONTH(DATE#(Mid(28042014,3,2),'MM'))/3)
Hi,
Try this,
'Q'&Ceil ([Month_Field]/3) as Qtr1
hi
Thanks all for the valuable response .
i tried the quarter name() but the o/p for the first quarter is ddifferent then the actual month.
Attaching herewith is the data and Qlikview .
also can anyone suggest for starting up with YTD and MTD
Thanking You
Vinayagam
QuarterName() takes date as parameter not month. Hence try like:
QuarterName(DATE(DATE#((left(Cdate,6)),'DDMMYY'))) AS QUATER