Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sasja
Contributor II
Contributor II

How can I disable a filter thats on my page for some visuals

I hope that there's someone over here that can help me.

I have a dashboard with some visuals and a filter on it.

In one filter I show the result of the sum for the max year selected. If there is not a year selected, then it wil take the last year of the whole dataset.

This works without any problem:

Sum(Aggr(Sum({<[Zitting_DeclaratieStatus]={"1","2"}, Jaar = {"$(=Max(Jaar))"}>}Distinct Zitting_ToegepastTarief), Zitting_AgendaId))

The problem is when I want to show the some sum, but then for the year before the selection. When I don't select a year from the filter, it does work.

It does not work when one year is selected. I tried a lot, but it seems that the filter on the dashboard filters the whole dataset for the whole page.  
This is mij code:

Sum(Aggr(Sum({<[Zitting_DeclaratieStatus]={"1","2"}, Jaar = {"$(=Max(Jaar)-1)"}>}Distinct Zitting_ToegepastTarief), Zitting_AgendaId))

This is a screenprint of an exemple of visuals and the filter.

Sasja_0-1702982670521.png

 

Labels (5)
1 Solution

Accepted Solutions
Sasja
Contributor II
Contributor II
Author

I found my answer:

Sum({$<Jaar=>}{<Jaar={$(=Max(Jaar)-1)}>} Aggr( SUM( {<Jaar={$(=Max(Jaar)-1)}>} ${<[Zitting_DeclaratieStatus]={"1","2"}>} Distinct Zitting_ToegepastTarief), Zitting_AgendaId))

I can't explean why this works, but I have tested it several times and it does. 

View solution in original post

5 Replies
Ravi_Nagmal
Contributor III
Contributor III

Try this:

Sum(Aggr(Sum({1<[Zitting_DeclaratieStatus]={"1","2"}, Jaar = {"$(=Max(Jaar)-1)"}>}Distinct Zitting_ToegepastTarief), Zitting_AgendaId))
Sasja
Contributor II
Contributor II
Author

Thank you for your reply, but is doesn't work.

I think the problem is with the filter thats on the page. This selects the 'Jaar' and makes that the dataset has only the selected 'Jaar' values in it. Now I want to calculate with values of 'Jaar'- 1.

It look those values are not in the dataset. Is it possible to exclude this filter visual from an different visual?

Sasja
Contributor II
Contributor II
Author

Maybe this screenshot makes it more clear what I want:

Sasja_0-1702991907494.png

The user can choose 1 or more years in the filter pane.

At the top left, it must shown the sum of all 'Zitting_ToegepastTarief' of all selected filter values.

At the top right, it must show the sum of 'Zitting_ToegepastTarief' of the latest year selected (=max year). 

The two at the top doe what I want, because that works with the filter pane.

At the bottum right, I want to show the sum of all 'Zitting_ToegepastTarief' of the previus year to the max jaar selected. It shows the correct value when I also select 2021 in this case. But when that year is not selected, it just shows '0'.

Is there any way to bypass the filter pane on my sheet for the lower right visual?

 
Ravi_Nagmal
Contributor III
Contributor III

Check this value in KPI box after applying filter if it is giving you required result.

{"$(=Max(Jaar)-1)"}

Sasja
Contributor II
Contributor II
Author

I found my answer:

Sum({$<Jaar=>}{<Jaar={$(=Max(Jaar)-1)}>} Aggr( SUM( {<Jaar={$(=Max(Jaar)-1)}>} ${<[Zitting_DeclaratieStatus]={"1","2"}>} Distinct Zitting_ToegepastTarief), Zitting_AgendaId))

I can't explean why this works, but I have tested it several times and it does.