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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Set Expression

sum( {<[To_YEAR] = {'$(=max([R_YEAR]+1))'},POL_TYPE={'R'}>} [PREMIUM] )

I have two date fields in my module  To_Year  and R_Year. When I select R_Year and apply above expression calculation is done correctly. That is  To_Year=2013   Selected R_year=2012

But if modify the above expression to add 2 years to R_year It does not work

sum( {<[To_YEAR] = {'$(=max([R_YEAR]+2))'},POL_TYPE={'R'}>} [PREMIUM] )

Please help me solve the above problem

6 Replies
Not applicable

Are To_Year and R_YEAR related (through data or any table ) ?

Is it possible that you have data with To_Year=2012 and R_YEAR = 2010 ?

Did you meet the maximum of To_Year (is it a valid value) ?

Fabrice

whiteline
Master II
Master II

Hi.

Does the [To_YEAR] contains the corresponding years ?

It seems that for +2 you should select 2011.

agilos_mla
Partner - Creator III
Partner - Creator III

Hi,

If you select R_Year=2012 then the set analysis return To_Year = 2014. If 2014 is not present in your dataset, it won't work.

Michael

upaliwije
Creator II
Creator II
Author

To_Year and R_Year are from two Master Calenders and relates to Data

upaliwije
Creator II
Creator II
Author

All years are present in my data set Even if I select 2010 as R _year it is not working

whiteline
Master II
Master II

Hi.

Is there any relation between the years fields ?

It's possible that for example R_YEAR=2011 selection cuts the dataset so that there is no any To_YEAR=2013 records, but there are To_YEAR=2012.

You can try this:

sum( {<[To_YEAR] = {'$(=max([R_YEAR]+2))'},POL_TYPE={'R'},[R_YEAR]=>} [PREMIUM] )