Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get sum of sales amount

Hi,

I am new to Qlikview. Need help.

I have two fields Year and Sales

I need expression to display sum of sales amount of years less than selected year.

9 Replies
Anonymous
Not applicable
Author

Hi,

Try this expression:

=Sum({$<Year={'<=$(=Max(Year))'}>}Sales)

Regards

Not applicable
Author

Hi, rajeshri

you can use Set Analysis to solve this.

store your selected year in a variable and then use set analysis

for example

sum( { $ < Year = { "<>$(vYear)" } > } Sales)

where vYear is a variable in which you store selected year

Hope it will help you

Regards

- Anil

Anonymous
Not applicable
Author

try this..

create a variable for the selected year.

selectedyear ==> IF(GetCurrentSelection(Year) = 0, Max(Year), GetCurrentSelection(Year))

Expression ==> IF(Year <= $(selectedyear), SUM(Sales))

hope that helps..

Not applicable
Author

Hello Vincent,

Thanks a lot.

Its working.

swuehl
MVP
MVP

Maybe try a set expression with implicite field value definition using e() function:

=Sum({$<Year= e() }>} Sales)

edit: I assumed that you want to exclude the selected year, if you want to just sum up all years prior the selected year, the first answer is correct

Anonymous
Not applicable
Author

you're welcome

Not applicable
Author

Swuehl Sir,

Can you please explain about e() function.

Regards

IndianQvLover

Not applicable
Author

It shows sum of all except selected year.

I used <= instead of <> now its working.

Not applicable
Author

Thanks, you are grate and genious.

Regards

- IndianQvLover