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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
jjremy
Contributor II
Contributor II

Dynamic dimension name (equivalent to f-string in python)

Hello everyone,

I think i'm not too far from what I try to get.

So i have a data with, among others, 3 columns: Paid2023; Paid2022; Month.

So each month, i have a row with the given month and the payments for the year 2023 (and resp. 2022) so far.
In a pivot table, I have one column for each year (dimension = YEAR). So I have one column for 2023 and one for 2022 for example.

In the rows, i have different measures. One should be 'Total Paid', and i would like Qlik to show the value of Paid2023 in the column 2023, and Paid2022 in the column 2022 (in the same row of course).

In python, I'd write something like f'Paid{YEAR}', using the f-string.
As far as I've gone, in Qlik, it gives something like Paid'&YEAR&'. But sadly this doesn't work.

There is maybe a work-around putting 'Paid'&YEAR&' and using FieldValue: FieldValue('Paid'&YEAR&',1)

But then it always displays the same value, the very first from the field, and not the one of the given month. (I put a filter on the month dimension, so I can check the evolution from month to month).
So probably this is not the right way (unless there is a way to avoid fixind that value position in the field, but I doubt it).

So if anyone has an idea on how to achieve this, it would be amazing 🙂
Thanks in advance and have a nice weekend,

 

Labels (5)
3 Replies
Digvijay_Singh

Not sure of exact needs but check if valuelist along with variables can help - 

https://help.qlik.com/en-US/sense/November2023/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/Synth...

 

Digvijay_Singh

Pl share sample data and expected output to explore few options available in the qlilk

jjremy
Contributor II
Contributor II
Author

Hello,
I'll certainly check for value list.
For the rest, in test.csv, you have the data I was trying to describe. So (for one client in that file), you have a line each month with two values, Paid2023 and Paid2022 who are just numbers then (I putted a second one too for some incasso, but with the same principle). I putted a second csv for the YEAR dimension (in my case it comes aswell from another dataset that is uploaded to QlikSense too).

And so what a would like to have is the following:

example.jpg

So i would have a measure 'Paid', and in the column 2022, it would show the value of Paid2022 and in the column 2023 the value of Paid2023.