Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sum of sales based on List box selection

Hi folks,

I have following requirement.

i have one list box for Month field.. i have expression for sum(sales) . if no month selected i need to show 12 months total sales. and if i selected april month i need to sum sales upto april..(Sum(sales)for jan feb march april(accumulation))..how can i do this...

Thanks in Advance..

Regards,

Venkat.

1 Solution

Accepted Solutions
yduval75
Partner - Creator III
Partner - Creator III

If you select Arpil, with sum(sales) in your expression you have the sales of April.

With sum({<Month={'<=$(=Max(Month))'}>} sales) in your expression, you have the sales from january to April

View solution in original post

11 Replies
yduval75
Partner - Creator III
Partner - Creator III

in your expression :

sum({<Month={'<=$(=Max(Month))'}>} sales)

tresesco
MVP
MVP

Sum(sales) - itself does it so by default.

Anonymous
Not applicable
Author

what about no selection condition??

can i have detailed code..pease...

yduval75
Partner - Creator III
Partner - Creator III

If you select Arpil, with sum(sales) in your expression you have the sales of April.

With sum({<Month={'<=$(=Max(Month))'}>} sales) in your expression, you have the sales from january to April

Anonymous
Not applicable
Author

hi tresesco,

it ll give only selected mnth sales..i need to show the accumulated sum of mnths...for ex if i select may i need to sum the sales of jan,feb,mar,april,may.

Anonymous
Not applicable
Author

Hi,

=sum({<Month={'<=$(=Max(Month))'}>} sales)


if no month is selected you will be able to show total sales Till date(meaning max month in datasource)

and if you select a month(in your case 'April'), April is taken as maximum month and sales is calculated upto here.


Hope its clear.


Regards

Neetha

kushalthakral
Creator III
Creator III

Dear Venkat

Please find the attached qvw for ur issue, it is working

Regards

Kushal T

tresesco
MVP
MVP

Sorry, misunderstood earlier. The solution suggested by Yoann Duval, should work. If not, it has to be because of month field data format. Try to share your sample qvw.

Anonymous
Not applicable
Author

i am using personal editor... can i hav code please....