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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
scotly-victor
Creator II
Creator II

Current Quarter

I want select current quarter

Quarter={$(=max(Quarter))} is this right way ?

3 Replies
sunny_talwar
MVP
MVP

How is the quarter created in the script?

'Q' & Ceil(Month(TempDate)/3) as Quarter

If it is like this, you can try this:

{<Quarter = {"$(=MaxString(Quarter))"}>}

Also if you want max Quarter from the most recent year, then may be this:

{<Quarter = {"$(=MaxString({<Year = {$(Max(Year))}>}Quarter))"}>}

scotly-victor
Creator II
Creator II
Author

Thank you for instant  reply

I wanted to create YTD,QTD,MTD,WTD .My code is

=if(DateTemp='YTD',sum({<type={'Order'},Year={$(=Max(Year))},Quarter=,Month=,Week=,OrderDate={"<=$(=Date(Max(OrderDate),'DD/MM/YYYY'))"}>}Sales),

if(DateTemp='QTD',sum({<type={'Order'},Year={$(=Max(Year))},Quarter={$(=max(Quarter))},Month=,OrderDate={"<=$(=Date(Max(OrderDate),'DD/MM/YYYY'))"},Week=>}Sales),

if(DateTemp='MTD',sum({<type={'Order'},Year={$(=Max(Year))},Quarter={$(=max(Quarter))},Month={$(=max(Month))},OrderDate={"<=$(=Date(Max(OrderDate),'DD/MM/YYYY'))"},Week=>}Sales),

if(DateTemp='WTD',sum({<type={'Order'},Year={$(=Max(Year))},Quarter={$(=max(Quarter))},Month={$(=max(Month))},Week={$(=max(Week))},OrderDate={"<=$(=Date(Max(OrderDate),'DD/MM/YYYY'))"}>}Sales),

sum({<type={'Order'},Year={$(=Max(Year))},Quarter=,Month=,Week=,OrderDate={"<=$(=Date(Max(OrderDate),'DD/MM/YYYY'))"}>}Sales)))))

But it didn't work

Can you please help with this ?

sunny_talwar
MVP
MVP

I did respond to your other post also. Can you check if that is working?