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

How to sum values taking into account filters?

Hi everyone,

I'm qlik sense entry level user...and as all new user problems start so quickly. I have a table containing the fields:

- cities

- countries

- clicks

it looks like:

CITY          COUNTRY          CLICKS

paris             France                 100

nice              France                   50

london          UK                         10

madrid          Spain                      5

barcelona      Spain                      2

In my app I use a filter by COUNTRY and a second filter by CITY and I wanto to show the number of clicks as a KPI value object according to filters applied by the app user. For instance, if I select:

Country filter: France

The KPI object should display 150.

I'm currently using the Sum(CLICKS) function in the KPI object  and the displayed value doesn't change with the filter selection. it is always displaying 167 (100+50+10+5+2).

How can I make a sum taking into account the current value of the filters?

Thanks in advance for your help,

Carlos

12 Replies
sunny_talwar

QlikView by default should be able to filter out un-selected values. Two things to check here

1) Is your data model correctly linked?

2) Are you using set analysis to ignore selection.

I think the issue might be the 1st one, but won't be able say much without looking at your app. Would you be able to share you app here?

Not applicable
Author

Hi Sunny,

Thanks for the reply. Yep, I can share the app here.

Carlos

sunny_talwar

Just from a quick investigation, I don't see a link between your two tables here:

Capture.PNG

Did you mean to keep them separate?

Not applicable
Author

Not really required actually. All the information I need is in the left table in your picture

C

sunny_talwar

Where you are making selection and which of the object is not working?

Not applicable
Author

They are the "affichages" and "clics" KPIs object displaying 2.54k and 946. Do you have any hint to make those indicators changes with the "pays" and "ville" filters?

Thanks,

Carlos

sunny_talwar

Those two KPI Objects are using the fields from an unrelated (unlinked) table (I pointed this out earlier also).

Capture.PNG

total clicks and total afffichages is not related to your other table and won't filter with any selection in fields from the other table. If you want it to filter, you would want to form a connection between them. What is one/ or more common field which is common between the two tables where the two tables can connect with each other?

sunny_talwar

You can use these two expressions and they seem to be working with selections

1) Sum(nombre_affichages)

2) Sum(nombre_clics)

No selection

Capture.PNG

With selection

Capture.PNG

Not applicable
Author

‌interesting! Can you send me back the app with your modifications pls?

I tried the Sum() function with the same fiels you mention but nothing changed...really weird

carlos