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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
sagaraperera
Creator
Creator

connecting expression

Dear All

I try to get a last year figure in my script given using given below expressins

sum( {$<TRAN_YEAR= {"$(=Only([TRAN_YEAR]-1))"}>} [Actual]) 

It is 100% work,

But i want to hard cord get a figure only GROSS_PREMIUM. I use get a current year GROSS_PREMIUM given below expression

Sum ( {$<DESCRIPTION= {'GROSS_PREMIUM'} >}[Actual])  

I WANT CONECT ABOVE TWO EXPRESSION AND GET A LAST YEAR  GROSS_PREMIUM ONLY.

Please help me.

Sagara

10 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

sum( {$<DESCRIPTION= {'GROSS_PREMIUM'} , TRAN_YEAR= {"$(=Only([TRAN_YEAR]-1))"}>} [Actual])

It is always better to use Max(TRAN_YEAR) in set analysis instead of ONly.  If you have multiple possible values your expression fails to calculate.

sum( {$<DESCRIPTION= {'GROSS_PREMIUM'} , TRAN_YEAR= {"$(=Max([TRAN_YEAR]-1))"}>} [Actual])


Hope this helps you.



Regards,

jagan.