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: 
balajisj30
Creator
Creator

Nested Set Analysis Expression

Hello People

I need to build an bar chart for Sum(revenue)/Sum(census) for the previous year. But when i write the below expression, it gives me null values.

=Sum({$<Year={"$(=Max(Year-1))"}>}(Sum(revenue)/Sum(census))

I modified the equation as revenue/census, but i get wrong values for the equation. As it divides row wise revenue by census and sums it.

=Sum({$<Year={"$(=Max(Year-1))"}>}revenue/census)


Please help me to find the solution to get sum of revenue by sum of census for previous year.


Thanks

Balaji

1 Solution

Accepted Solutions
zhadrakas
Specialist II
Specialist II

try like this

=Sum({$<Year={"$(=Max(Year)-1)"}> } revenue)/ Sum({$<Year={"$(=Max(Year)-1)"}> } census)

View solution in original post

2 Replies
zhadrakas
Specialist II
Specialist II

try like this

=Sum({$<Year={"$(=Max(Year)-1)"}> } revenue)/ Sum({$<Year={"$(=Max(Year)-1)"}> } census)

justinphamvn
Creator II
Creator II

Hi,

Try this :

Sum({$<Year={"$(=Max(Year) - 1)"}>} Revenue)

/

Sum({$<Year={"$(=Max(Year) -1)"}>} census)

Hope this help

Justin.