Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
DWolsie
Contributor III
Contributor III

"v" Functions

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.

DWolsie_0-1738056828734.png

I believe this is best shown by the following Sankey Chart:

DWolsie_1-1738057058029.png

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.

DWolsie_2-1738057219782.png

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!

Labels (1)
1 Solution

Accepted Solutions
JordyWegman
Partner - Master
Partner - Master

It would be easy if you could share an example app of this. It's easier testing for us this way.

Jordy

Climber

Work smarter, not harder

View solution in original post

9 Replies
henrikalmen
Specialist II
Specialist II

vPeriodMax is not a funtion, it's a variable. The value is retrieved using dollar sign expansionhttps://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/Scripting/dollar-sig...

The variables are used within what's called set expressionshttps://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.

JordyWegman
Partner - Master
Partner - Master

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

Work smarter, not harder
DWolsie
Contributor III
Contributor III
Author

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?

henrikalmen
Specialist II
Specialist II

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.

JordyWegman
Partner - Master
Partner - Master

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:

Screenshot 2025-01-28 at 11.31.24.png

Now filter on the name of the variable in the overview

Screenshot 2025-01-28 at 11.32.27.png

You can see there that you can also create the variables.

Jordy

Climber

Work smarter, not harder
DWolsie
Contributor III
Contributor III
Author

Ah yes thanks I've found them!

DWolsie_0-1738060528833.png

 How would I use these to get the fields to show the figures I desire?

JordyWegman
Partner - Master
Partner - Master

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.

Work smarter, not harder
DWolsie
Contributor III
Contributor III
Author

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?

JordyWegman
Partner - Master
Partner - Master

It would be easy if you could share an example app of this. It's easier testing for us this way.

Jordy

Climber

Work smarter, not harder