Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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

Re: Use filter in statisticbox with sum() where pretended filter

Like this?

12 Replies
MVP
MVP

Re: Use filter in statisticbox with sum() where pretended filter

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

Re: Use filter in statisticbox with sum() where pretended filter

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'

MVP
MVP

Re: Use filter in statisticbox with sum() where pretended filter

Like this?

Not applicable

Re: Use filter in statisticbox with sum() where pretended filter

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

Re: Use filter in statisticbox with sum() where pretended filter

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

MVP
MVP

Re: Use filter in statisticbox with sum() where pretended filter

Try

Load City, SUM(Amount) as BerlingNYAmount Resident Temp

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

Not applicable

Re: Re: Use filter in statisticbox with sum() where pretended filter

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

MVP
MVP

Re: Re: Use filter in statisticbox with sum() where pretended filter

Share your QVW please

Not applicable

Re: Re: Re: Use filter in statisticbox with sum() where pretended filter

and what about if i wanna select x=ID like

x= >3 and x=<5

Community Browser