Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I extract quarter from a date column? I dont like the format of QuarterName function of QlickView. I want a simple display like Q1, Q2, Q3, Q4. Any pointers?
Thanks,
Dinesh.
How about if the Calendar starts from April. Please don't show me the inline method.
I am using this below script. But it's incomplete i guess.
'Q' & Ceil(Month(Date)/4) as Quarter
Regards,
There are probably several approaches,
='Q' & ceil((mod((Month(Date)+8),12)+1)/3)
='Q' & pick(Month(Date),4,4,4,1,1,1,2,2,2,3,3,3)
or using a Mapping Table
MAP:
MAPPING LOAD * INLINE [
Month, Quarter
1,Q4
2,Q4
3,Q4
4,Q1
5,Q1
6,Q1
7,Q2
8,Q2
9,Q2
10,Q3
11,Q3
12,Q3
];
MAP Quarter using MAP;
LOAD
Month(Date) as Quarter,
...
Swuehl,
Thanks dear, It works.
Another alternative would be:
='Q' & Ceil(Month(AddMonths(Date,-3))/3)
-Rob
Forma mais simples, rápida e funcional.
Serviu perfeitamente para solucionar o meu problema.
Obrigado Rob.
What ?
De nada.
-Rob
Thank you! This worked nicely for me as my company has a different Fiscal Calendar so I was able to set the Quarters as needed.
Hi sir,
instead of lengthy, you can use as script as below:
'Q' & Ceil(Month(AddMonths(DATE,-3))/3) as QUA ,
here DATE means your DATE field,
then followed that another requirement may be raise as Fiscal year,
for Q1, Q2, Q3 = current year + Next year (2019-2020)
for Q4 = Last year + Current Year (2018-2019),
for that
if(QUA='Q4', Year(DATE)-1 &'-'& Year(DATE), if(QUA='Q3', Year(DATE) &'-'& (Year(DATE)+1),if(QUA='Q2', Year(DATE) &'-'& (Year(DATE)+1),if(QUA='Q1', Year(DATE) &'-'& (Year(DATE)+1),'')))) as Fiscal Year,
Result will be:
Enjoy with qlik,
K. Srinivasan.
Result will be:
K. Srinivasan.