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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rolling Fiscal Quarter

So I have to create sales for current quarter and preceding quarters using set analysis.

I've got a numeric QuarterID in my script and am using the following expression:

SUM({$<QuarterID = {$(=ONLY(QuarterID)-1)}>}Sales)

But this is only working if I specifically select numeric QuarterID from a list box. I would much rather the user select a year and Q1, Q2, etc. But this doesn't seem to work, even though the QuarterID seems correctly associated with the combination of year and Quarter. It also seems that if I select Year and the QuarterID, it still displays correctly. It is when I add in the Q1 the link stops working correctly. Something is wrong here...

Labels (1)
6 Replies
Anonymous
Not applicable
Author

And getting more to root of issue, the expression works as expected when no subtraction is involved. I can select Year and Quarter with no issue and it will display current quarter sales using set analysis, it is the addition of the "-1" that is causing the problem. I am missing something here...

This works:

SUM({$<QuarterID = {$(=ONLY(QuarterID))}>}Sales) //for displaying current quarter

This does not work with associated selections:

SUM({$<QuarterID = {$(=ONLY(QuarterID)-1)}>}Sales) //for displaying previous quarter

Anonymous
Not applicable
Author

Nevermind... I got it. I just added a further code to ignore the "Q" selection. Worked like a charm...

Not applicable
Author

What code you added to ignore Q in the Quarter?

suniljain
Master
Master

you can ignotre Q by Right Function

Not applicable
Author

Got it!

eleni_theodorid
Partner - Creator
Partner - Creator

Hi,

Could you please post the answer? Cause, I couldn't make it work right.

Do you mean something like this sum( {$<FiscalQuarter={$(=Right({<FiscalQuarter={$(=Only(FiscalQuarter))}>},1))}>} Sales) ???

Thanks in advance,

Helen