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
Chanty4u
MVP
MVP

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

tresesco
MVP
MVP

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

tresesco
MVP
MVP

Your 'and' is improper here. It should be replaced by a comma (,).

Anonymous
Not applicable

may be like this?


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


or


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

and check this as well, helpful for you?

Set Analysis for certain Point in Time

Set Analysis for Rolling Periods

Anonymous
Not applicable

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

Digvijay_Singh

Just wanted to know the use of 'only' here, I think its not making sense here, may be  I am missing something..

Anonymous
Not applicable

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


-1 is given the outside of the braces

tresesco
MVP
MVP

Yes it would even work similarly without the function only(). It's that - to tell explicitly that the expression would work only on - single value selection of Year field TRAN_YEAR.

Not applicable

Hi

PLEASE TRY THIS EXPRESSION.

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