Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

To extract current and previous quarters data.

Hi All,

I want to write a conditon in such a way that i need to extract data for current and previous quarter.

how do i write condition in script to get that data.

Plsss help......

thanks in advance

3 Replies
Not applicable
Author

Hi,

You can define a flag in the script like:

(month(today(0))&Ceil/3) as CurrentQtr

The same approach can be done for Previous Quarter.

So every time the Month changes in the system calendar it will affect on Quarter too

Regards,

Sunil

Not applicable
Author

u can use Inquarter() or InQuartertodate() functions to get current and Previous quarter

Not applicable
Author

Hi,

InQuarter etc will only return a true/false statement - if you are looking for 1,2,3,4 then sunils will work but with a slight tweak

ceil(month(today(0))/3)

The ceil in that location will be seen as a field name.   Ceiling the whole result will give you the current quarter