Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I'm relatively new to Qlik Sense, but I've inhereted a Dashboard from a colleague who's no longer at my company.
I've got a very complicated set of KPI's that truly only a mother could love.
Both these fields show values of figures where Date A (Fälligkeitsdatum) is equal to 2025. The difference lies in that for the left field, Date B (Belegdatum) is equal to everything before 2025, while the right field of Date B is equal to 2025.
I believe this is best shown by the following Sankey Chart:
Here we see that the Fälligkeitsdatum is equal to 2025 (right side) and the Belegdatum is different. The 2023 and 2024 figures would go in the left KPI, while the belegdatum of 2025 would go in the right field.
Unfortunately, this is not the end. In a filtermenu, we have the choice to select as many years as we want.
The idea is now, that on the left all figures before a Belegdatum of 2024 is take, while on the right the Belegdatum equal is to 2024 to 2025. This would look like this in the Sankey chart.
My colleague has attempted to set this up using v functions. Something I have never seen in my life and have no idea how to use.
For the left field he uses this:
Sum({$<[WRTTP]={"24"},
BUDAT={$(vPeriodMax)},
[BLDAT]={$(vPeriodBefore)}>}
WTGBTR)
And for the right field this:
Sum({$<[WRTTP]={"24"},
BUDAT={$(vPeriodMax)},
[BLDAT]={$(vPeriodMin)}>}
WTGBTR)
Where BLDAT is belegdatum and BUDAT is fälligkeitsdatum.
For one, can someone explain what these v funktions are and how to use them?
And for two, what combination of v funktions and fields should I use to get the desired results?
Thanks in Advance!
It would be easy if you could share an example app of this. It's easier testing for us this way.
Jordy
Climber
vPeriodMax is not a funtion, it's a variable. The value is retrieved using dollar sign expansion. https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/Scripting/dollar-sig...
The variables are used within what's called set expressions. https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/ChartFunctions/Se... It's kind of a way to override/make selections within a calculations.
Hey,
These functions are not functions but variables. Look at the variable overview in the front-end and you will find vPeriodMax.
Or it's in the script and you will see:
- let vPeriodMax = ...;
So it will say BUDAT = '2025-02'; (if this is how a period looks for you).
Try to create a table and enter this in the dimension:
='$(vPeriodMax)'
Then you can see what is in the variable due to the dollar expansion -> $().
Jordy
Climber
Thank you so much! Do you have any idea where this variable has been created? I cannot find it in the script editor.
Additionally, do you know how I could get the desired results without using these variables?
The variable editor can be found at the bottom of the assets panel in the edit mode of a sheet. Basically it's a button in the bottom left corner of the qlik sense window. The variables definitions are probably some kind of calculations. You need to check that, and understand it, to be able to determine if you should do the kpi calucalations some other way than they are calcuated now.
If it's not in the script, it's in the variable overview. Go to a new sheet, go into edit mode and check this:
Now filter on the name of the variable in the overview
You can see there that you can also create the variables.
Jordy
Climber
Ah yes thanks I've found them!
How would I use these to get the fields to show the figures I desire?
Based upon the outcome of GJAHR you can change how the variable is behaving. Because you can see that it refers from vPeriodMax to vGJARHMax. So whatever you put in there, will become vPeriodMax.
Thank you so much for your help already, I believe I am a bit overwhelmed by the complexity of it. I fear that the variables as I have shown are not sufficient for what I am attempting to display, regardless of whether I understand them or not. Would you be able to provide an example, of how I could use custom variables to show the sum of the variable, where the belegdatum is smaller than the smallest chosen gjahr, and the fälligkeitsdatum is equal to the range of the smallest to the highest Gjahr?
It would be easy if you could share an example app of this. It's easier testing for us this way.
Jordy
Climber