
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quarter Function
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.
- Tags:
- new_to_qlikview
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I currently use the below formula. Hopefully there is a simpler way:
if(month(UCCDATE)='Jan','Q1',
if(month(UCCDATE)='Feb','Q1',
if(month(UCCDATE)='Mar','Q1',
if(month(UCCDATE)='Apr','Q2',
if(month(UCCDATE)='May','Q2',
if(month(UCCDATE)='Jun','Q2',
if(month(UCCDATE)='Jul','Q3',
if(month(UCCDATE)='Aug','Q3',
if(month(UCCDATE)='Sep','Q3',
if(month(UCCDATE)='Oct','Q4',
if(month(UCCDATE)='Nov','Q4',
if(month(UCCDATE)='Dec','Q4')))))))))))) as Quarter,


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try:
'Q' & ceil(month(UCCDATE)/3)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try This coad, this might help you.
'Q' & ceil(month(UCCDATE)/3)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How would you do it if your quarter only starts at april

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This works nicely other than getting just a blank "Q" on its own. Why am I getting that?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alex, you are only getting a 'Q' with no quarter number? Have you tried just using
ceil(month(DATE)/3) as Quarter,
to look if you got a number from that, if not, try just a month(DATE) and if this doesn't return a number than look at your DATE field. It mus be a recognozed QV date/timestamp type, i.e. must have a numerical representation.
Or am I misunderstanding your question?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I just use ceil(month(DATE)/3), I get just 1, 2, 3, 4.
Would it be doing this because I am using a list box? And I'm not doing it in the script?
And no, in the expression I get this: Q, Q1, Q2, Q3, Q4. I don't need the first Q value.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Because some of your dates are null. To filter them out use:
=if(len(DATE)>0, 'Q' & ceil(month(DATE)/3))
-Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great, thanks Rob. That did the trick.

- « Previous Replies
-
- 1
- 2
- Next Replies »