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: 
New-Qlik
Creator III
Creator III

Qliksense set analysis expression

Hello ,

I have a requirement in which I need to calculate\

expression1 = Sales* quantity LFY/ weight* Quantity LFY

Note :   LFY is last fiscal year and I have a column name LYear column have fiscal year

for quantity LYD I did =  Sum({$<Year={$(=Max(LYear)-1)}>}quantity)


but when I try to multiply it with

Avg(Sales * Sum({$<Year={$(=Max(LYear)-1)}>}quantity))

/

Avg(price * Sum({$<Year={$(=Max(LYear)-1)}>}quantity))


it gives me no output. Any idea where ist going wrong.

1 Solution

Accepted Solutions
vamsee
Specialist
Specialist

Try

( Avg({<Year={"$(=Max(LYear)-1)"} >}Sales ) * Sum({<Year={"$(=Max(LYear)-1)"} >}quantity) )

/

( Avg({<Year={"$(=Max(LYear)-1)"} >} price )* Sum({<Year={"$(=Max(LYear)-1)"} >}quantity) )



-------------------------

You have to add set for Avg() also, Set Analysis is calculated Once Per Chart not at every row.


View solution in original post

2 Replies
vamsee
Specialist
Specialist

Try

( Avg({<Year={"$(=Max(LYear)-1)"} >}Sales ) * Sum({<Year={"$(=Max(LYear)-1)"} >}quantity) )

/

( Avg({<Year={"$(=Max(LYear)-1)"} >} price )* Sum({<Year={"$(=Max(LYear)-1)"} >}quantity) )



-------------------------

You have to add set for Avg() also, Set Analysis is calculated Once Per Chart not at every row.


New-Qlik
Creator III
Creator III
Author

Same expression I have to calculate as LYTD ie last year to date. can u help

Avg(Sales * LYTDquantity))

/

Avg(price * LFYquantity