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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
10 Replies
Chanty4u
MVP
MVP

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

tresB
Champion III
Champion III

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

tresB
Champion III
Champion III

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

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

tresB
Champion III
Champion III

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])