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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Luben
Creator
Creator

set analysis

how can I convert this if statement to set analysis t

=if(
'$(vQty)' = 'Qty',
sum([ Quantity]),
sum ([Unit ] * [ Quantity])

)

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like below

=if(
'$(vQty)' = 'Qty',
sum({<YEAR= {$(=MAX( YEAR)-1)}>}[ Quantity]),
sum ({<YEAR= {$(=MAX( YEAR)-1)}>}[Unit ] * [ Quantity])

)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
Vegar
MVP
MVP

What are you trying to achieve with set analysis that you don't in your current expression? I think your expression looks fine.

Luben
Creator
Creator
Author

want to make the above expression to look at last year 

like {$(=MAX( YEAR)-1)}

MayilVahanan

Hi

Try like below

=if(
'$(vQty)' = 'Qty',
sum({<YEAR= {$(=MAX( YEAR)-1)}>}[ Quantity]),
sum ({<YEAR= {$(=MAX( YEAR)-1)}>}[Unit ] * [ Quantity])

)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.