Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Thijs
Partner - Contributor
Partner - Contributor

Juiste visualisatie aanpassen aan selectie

Goedenmiddag! Allereerst zit ik nog in de beginnersfase maar ik heb alvast 1 vraag waar jullie wss zo van zeggen: "aaaah maar dat moet je zo doen..."

Ik wil een KPI maken waarbij ik de totale omzet van een jaarweergeef en daaronder het verschil in omzet tov het vorige jaar (zie bijlage)Schermafbeelding 2023-03-23 om 14.52.53.png.

Nu hebben we dit gedaan met:

(Sum({$<Declaratie_status={"1", "2"}, Jaar = {"$(=Max(Jaar))"}>} (ToegepastTarief))

-
Sum({$<Declaratie_status={"1", "2"}, Jaar = {"$(=Max(Jaar)-1)"}>} (ToegepastTarief)))

/

Sum({$<Declaratie_status={"1", "2"}, Jaar = {"$(=Max(Jaar))"}>} (ToegepastTarief))

Hierdoor is het afhankelijk of er al data is van een volgend jaar, is dit geval 2024. Nu ziet deze formule het verschil tot het hoogste jaar en de jaar daarvoor. Ik wil dit onafhankelijk maken en zich laten aanpassen aan de selectie: 'Jaar' en dan daarop het juiste tonen van het jaar daarvoor (dus selectie jaar=2023 is weergave van het jaar daarvoor "Jaar=2022"). Nu is het dus vastgezet dat er al data van 2024 bekend is dat 'het voorgaande jaar' nu al 2023 is ongeacht van de selectie die ik maak. Hoe zou ik dit kunnen oplossen? Zoals gezegd graag zoveel mogelijk in jip en janneke taal dan gaat het me uiteindelijk wel lukken. Thanks alvast!!

Labels (1)
1 Reply
SBN
Contributor III
Contributor III

Hi Thijs,

I can answer in Dutch, but it might be helpful for others to answer this question in English.

So what you're trying to accomplish is to get the KPI value for Sales depending on the selected year in a filter pane, right?
So what you can do in your set analysis is use the function "GetFieldSelections" to look at the selected "Jaar" and do something like this.

Where you have defined Jaar = {"$(=Max(Jaar))"}>} you can change this to Jaar = {"$(=GetFieldSelections(Jaar))"}>}.

The thing with filter panes is that you can select multiple values. So it might be possible for a user to select multiple years.
Than your expression won't work and won't show anything apart from a "-".
So what you need to add an If statement in front of the the expression in which you check the amount of selected values.
You can use the function "GetSelectedCount()" for that.
And if there's anything other than 1 selection you should you a message in the KPI like this "1 jaar selecteren ajb".
I can give you the expression, but it's better to experiment and learn with some directions and hints...😉

Good luck!