# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Contributor

## 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
Valued Contributor

## Re: Set Analysis Expression

try like this

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

2 Replies
Valued Contributor

## Re: Set Analysis Expression

try like this

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

Contributor II

## Re: Set Analysis Expression

Hi,

Try this :

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

```

Hope this help

Justin.

Community Browser