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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
lessassy
Creator
Creator

variable for quarter in set analysis

Hello everyone,

 

I have created a master calendar and i have a time dimenson called Quarter-Year which has value such as

'T1-2019', 'T2-2019' and so on....

 

The thing is i want to use a variable to compare let's say a value at T1-2020 to T1-2019.

Usually for year i use a variable so let's say vCurrentYear = max(year(DATE_Field)) and vPreviousYear = max(year(DATE_Field)-1)

 

I have a specific example which is :

if (Quarter-Year = 'Q1-2019',SUM({<CAT_CONTRAT = {'CDI'},[Quarter-Year] = {'Q1-2019'}>}ABS_DIR_JRS_OUV)/SUM({<CAT_CONTRAT = {'CDI'},[Quarter-Year] = {'Q1-2019'}>}NB_JRS_THEO_TRAVAIL),

if (Quarter-Year = 'Q1-2020,SUM({<CAT_CONTRAT = {'CDI'},[Quarter-Year] = {'Q1-2020'}>}ABS_DIR_JRS_OUV)/SUM({<CAT_CONTRAT = {'CDI'},[Quarter-Year] = {'Q1-2020'}>}NB_JRS_THEO_TRAVAIL),))

The result will be ok but i want to compare Quarter Year N to Quarter PreviousYear

 

DO you know how i could do that ?

Thank you a lot

 

In my master calendar the "quarter year" is this one: 'T' & ceil(Month(TempDate)/3)&'-'& Right(Year(TempDate),2) as QuarterYear,

Labels (1)
1 Solution

Accepted Solutions
raji6763
Creator II
Creator II

hi,

you may be try this

DATE= {">=$(=quarterstart(min(DATE),-4))<$(=quarterstart(min(DATE),-3))

 

https://community.qlik.com/t5/QlikView-Layout-Visualizations/How-compare-two-quarter-in-different-ye...

 

 

regards,

raji

View solution in original post

3 Replies
raji6763
Creator II
Creator II

hi,

you may be try this

DATE= {">=$(=quarterstart(min(DATE),-4))<$(=quarterstart(min(DATE),-3))

 

https://community.qlik.com/t5/QlikView-Layout-Visualizations/How-compare-two-quarter-in-different-ye...

 

 

regards,

raji

lessassy
Creator
Creator
Author

it worked thank you.

I tried also instead of

 

Quarter-Year = 'Q1-2019' i put Quarter-Year = 'Q1-'&'$(=vCurrentYear) or Previous Year and it work pretty well too.

Anyway thanks for the tips

raji6763
Creator II
Creator II

if you got solution.please close this thread.