3 Replies Latest reply: May 1, 2016 11:56 AM by Sunny Talwar

# Current Quarter

I want select current quarter

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

• ###### Re: Current Quarter

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))"}>}

• ###### Re: Current Quarter

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