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

Use filter in statisticbox with sum() where pretended filter

Hi guys,

how can I use many filters to get a sum() ?

My script:

load ID, Name, City, Amount From ...

Now I want to use a statusbox, to sum the amount with specific filter like:  amount from Berlin and London; or amount from Dublin,...

with that funktion filter, I want to show the amount, that I really need.

Because I want to show many Amounts without selecting by clicking this to compare them -  like to have an overview in my statisticbox with many sums..

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

12 Replies
MK_QSL
MVP
MVP

You can use the Resident Load with Where Condition and Group By clauses..

Kindly Update your sample data along with desired out put. will try to help you out.

Not applicable
Author

just like:

load * inline [

ID, Name, City, Amount

1, John Smith, London, 10

2, Harry Gordon, Paris, 20

3, Lisa Müller, Berlin, 30

4, Josh Miller,New York, 40

5, Elisabeth Miller, New York, 50

];

Now I don't want to select / filter by my Script. I want to use the statisticsbox for sum:

1. box "Europe": sum( Amount) where "City" = 'Berlin' and where "City" = 'London'  and where "City" = 'Paris'

2. box" USA": sum(Amount) where "City" = 'New York'

MK_QSL
MVP
MVP

Like this?

Not applicable
Author

Yes right, but what about if I need more then 1 filter/condition like:

Amount from Berlin and New York?


Load City, SUM(Amount) as Europe Resident Temp where City = 'New York'  and where City = 'Berlin' Group By City;

didn't work.

Not applicable
Author

What I mean is to use several times the where command for filterung the City and ID

MK_QSL
MVP
MVP

Try

Load City, SUM(Amount) as BerlingNYAmount Resident Temp

Where City = 'New York' or City = 'Berlin' Group By City;

Not applicable
Author

Thanks much !

But I still got a problem:

If I use:


Load City, SUM(Amount) as USA.Amount Resident Temp where City = 'New York' Group By City;

within using statisticsbox: sum(USA.Amount)

t.jpg

MK_QSL
MVP
MVP

Share your QVW please

Not applicable
Author

and what about if i wanna select x=ID like

x= >3 and x=<5