Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

not equal in set expression

I have following expression which is working fine

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

But one I modify it in the following way it does not work

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

Pls help me write it correctly

11 Replies
vishsaggi
Champion III
Champion III

Are you getting any error or not getting any values?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this.

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

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
antoniotiman
Master III
Master III

Hi,

Try to add DISTINCT in Concat

or instead try this

R_MONTH=E(R_MONTH)

Regards,

Antonio

upaliwije
Creator II
Creator II
Author

I do not get any value

upaliwije
Creator II
Creator II
Author

Still the Value is 0

vishsaggi
Champion III
Champion III

Referring to Kaushik and Antonio's expression try this ?

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

upaliwije
Creator II
Creator II
Author

It give a value but amount is wrong.

Screenshot_1.png

1st column shows my original expression  2nd one shows as per your expression. value in 2 nd  column should an amount less than 1st column. pls help

sunny_talwar

Would you be able to explain in words about what you are trying to do here?

upaliwije
Creator II
Creator II
Author

Thanks Sunny,

What I want is the following. In my first Column I showed all the Premium renewed for the particular month (Renewal Date relates to same month). In the second column I want to show the Premium renewed in that particular month of which renewal date does not fall into that particular month Eg Premium Renewed in June but should have been renewed in May. R_Month is the relevant month