Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Highlighted
venkat_94b4
Contributor

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.

Tags (1)
1 Solution

Accepted Solutions
Partner
Partner

Re: Sum of sales based on List box selection

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
Partner
Partner

Re: Sum of sales based on List box selection

in your expression :

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

MVP
MVP

Re: Sum of sales based on List box selection

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

venkat_94b4
Contributor

Re: Sum of sales based on List box selection

what about no selection condition??

can i have detailed code..pease...

Partner
Partner

Re: Sum of sales based on List box selection

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

venkat_94b4
Contributor

Re: Sum of sales based on List box selection

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.

neetha_p
Honored Contributor

Re: Sum of sales based on List box selection

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
Contributor III

Re: Sum of sales based on List box selection

Dear Venkat

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

Regards

Kushal T

MVP
MVP

Re: Sum of sales based on List box selection

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.

venkat_94b4
Contributor

Re: Sum of sales based on List box selection

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