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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

set Expression

Sorry I attched wrong file  Pls see the correct file

I have Created the following expression

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

But It is not working. I attach herewith the file. What I really need is the following calculation

When User Select R_Year=2013  and R_Month=Jan

The Result should be To_Year=R_Year+1(2014)

                                To_Month=R_Month(Jan)

                                 Type+'F'

                                  and sum of Premium

Please help me to write the correct Expression

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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


talk is cheap, supply exceeds demand
upaliwije
Creator II
Creator II
Author

Hi Gysbert

Thanks very much

it is working fine. I want one more modification to be done. That is I want to exclude records from the above expression where R_Year=2013 and R_Month=Jan (Records relating user selected Year and Month). Pls Help.

Thanks In Advance

MK_QSL
MVP
MVP

Remove below from your expression

R_YEAR=, R_MONTH=,

upaliwije
Creator II
Creator II
Author

Then only the records relating to that particular period remains

T_DATER_DATEPERIOD_TOCol 1

2013-01-222013-01-222014-01-21-862
2013-01-212013-01-212014-01-05-23,127
2013-01-172013-01-172014-01-04-7,615
2013-01-292013-01-292014-01-06-24,505
2013-01-112013-01-132014-01-12-8,352
2013-01-312013-01-312014-01-01-40,055
2013-01-112013-01-112014-01-06-882
2013-01-182013-01-182014-01-16-6,768
2013-01-302013-01-302014-01-28-19,324
2013-01-102013-01-102014-01-09-16,554
2013-01-302013-01-302014-01-27-19,784

But in fact what I want is to exclude above records and to other records to remain