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

Announcements
Maximize ROI with Qlik Professional Services – Expert Guidance, Faster Results: Explore Qlik Services
cancel
Showing results for 
Search instead for 
Did you mean: 
akraman
Contributor II
Contributor II

Starting at the beginning of a Year-Quarter with Set Analysis

Currently I have this for a master item used in a bar graph that has a three year interval as defined by the variables:


sum({<

Year=,
Month=,

[%DateKey] = {">=$(vRollingStart)<=$(vRollingEnd)"}

>}[Invoice Revenue] * [FX]
)

 

I would like to have the "vRollingStart" lock in a date that is at the beginning of the closed Year-Quarter currently defined as: 

=Date(MonthStart(AddMonths(Max([Calendar Date]),-35)),'MM/DD/YYYY')

 

vRollingEnd is: 

=Date(MonthEnd(Max([Calendar Date])),'MM/DD/YYYY')

It would be nice to have this go to the nearest last full quarter as well.

Any ideas on how to accomplish this with either changing the variable(s) or master item?

 

 

Labels (4)
1 Solution

Accepted Solutions
brunobertels
Master
Master

Hi 

quarterstart() and quarterend() may be usefull here 

quarterstart(today()) will give you 01/07/2024 

for previous quarter it will be quarterstart(today(),-1) = 01/04/2024 

same logic with quarterend() function : 

current quarter date end quarterend(today())

previous quarter date end quarterend(today(),-1)

 

hope it helps

View solution in original post

2 Replies
brunobertels
Master
Master

Hi 

quarterstart() and quarterend() may be usefull here 

quarterstart(today()) will give you 01/07/2024 

for previous quarter it will be quarterstart(today(),-1) = 01/04/2024 

same logic with quarterend() function : 

current quarter date end quarterend(today())

previous quarter date end quarterend(today(),-1)

 

hope it helps

akraman
Contributor II
Contributor II
Author

Hi Brunobertels,

 

Yes quarterstart(), is ultimately what worked for me!  I used QuarterStart(AddMonths(Max([Calendar Date]), -36)) for vRollingStart and QuarterEnd(AddMonths(Max([Calendar Date]), -3)) for vRolling end, and the visulaization locked in place.  Thank you for confirming.