Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
pal25
Contributor III
Contributor III

How to get quarters in a form of Q1 , Q2 , Q3 and Q4 from a date

How to get quarters in a form of Q1 , Q2 , Q3 and Q4 from a date. A sample formula should help.

Need to use this in a bar chart

Labels (7)
3 Replies
eronevil
Creator
Creator

i would do this at in script. Nested IF sentense

Table:

Load

Date,

if(date<01.01.2022 and date > 01.03.2022, Q1,

if(date<01.03.2022 and date > 01.06.2022, Q2,

if(date<01.06.2022 and date > 01.09.2022, Q3,

if(date<01.09.2022 and date > 31.12.2022, Q4)))) as quater

From table;

 

Then in Bar chart add quater in x -axis

-V

marcus_sommer

You may do it in this way:

'Q' & ceil(month(DATE)/3) as Quarter

- Marcus

vinieme12
Champion III
Champion III

Creating a separate calendar table would be good

refer below

https://qlikviewcookbook.com/2015/05/better-calendar-scripts/

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.