# New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for
Did you mean:
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 (3)

• ### Set Analisys

1 Solution

Accepted Solutions
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

3 Replies
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

Creator

it worked thank you.