Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

set expression

Hi Friends,

I want to calculate renewed premium in respect of insurance business and I have developed a QV doc which I have attached h/w

Screenshot_1.png

In the above renewed premium column the highlighted amount  should not appear. Pls help me to modify the expression in my attached QV doc

11 Replies
upaliwije
Creator II
Creator II
Author

Hi,

Refunds are recorded in column 5 while max Period_to field is the current period for non renewed policies

upaliwije
Creator II
Creator II
Author

Hi Friends

Thank you all for helping me. I have found a solution to my problem. But I have a small issue where I do not get the correct total in the last column of the below pivot table pls look into this and help me

Screenshot_1.png

My expression for the last column is as follows

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

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

-sum( {$<[R_YEAR] = {'$(=max([R_YEAR]))'}>} [PREMIUM] )