# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor III

## Use of less than in set analysis expression

Hi People

I have a requirement to build bar chart with sales of selected year and less than selected year.

I have used this expression to show previous year data,

=Sum({\$<acc_period_year={"<acc_period_year"}>}bill_size)

Thanks

Balaji

1 Solution

Accepted Solutions
Contributor III

## Re: Use of less than in set analysis expression

Try This

Sum({< acc_period_year = {"<=\$(=max(acc_period_year)-1)"}>} bill_size)

regards

An Pham

5 Replies
Contributor II

## Re: Use of less than in set analysis expression

May be try this,

Sum({< acc_period_year = {"\$(=max(acc_period_year)-1)"}>} bill_size)

New Contributor III

## Re: Use of less than in set analysis expression

your expression gives me sales value of only the previous year. But i want to display sales value of all the years below the selected year.

Contributor II

## Re: Use of less than in set analysis expression

For that you can just subtract the max year by -2 for getting previous year sales

Contributor III

## Re: Use of less than in set analysis expression

Try This

Sum({< acc_period_year = {"<=\$(=max(acc_period_year)-1)"}>} bill_size)

regards

An Pham

Honored Contributor II

## Re: Use of less than in set analysis expression

try this below:

Sum( {< acc_period_year = {"<\$(=max(acc_period_year))"}>} bill_size)