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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
etienne2
Contributor
Contributor

Label expression using another field

Hi,

there's something i don't understand regarding label expressions. i think my query is quite simple but i can't figure out how to do it in qliksense.

Basically my database looks like this. The idea is that in some charts i'm pulling for example the measures "Sales Budget" and "Sales latest forecast".  I wanted to define "Sales latest forecast" as a master measure and give it a dynamic label which would always refer to what stand in "Scenario field" so the user can actually see what scenario is considered as the latest. In below sample, the scenario 2+10 is the one from previous month, and the 3+9 is the latest.

I'd think that we can make dynamic the label of the field "Sales latest forecast" so that it gets updated based on what is in the data, however i can't make it work. The Scenario is not a field that gets selected by the user, so i don't think we can use getfieldselection function. That sounds very simple, but i have not found any simple answer yet.

thanks for your help

ScenarioSalesSales BudgetSales actualsSales previous forecastSales latest forecast
Actual             1 000                             -                       1 000                                            -                                       -  
Budget             3 500                      3 500                            -                                              -                                       -  
2+10             2 000                                       2 000 
3+9             3 000                                 3 000
Labels (1)
2 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Etienne,

Why would you create a table like this? It will give a lot a lot of null values, and way too big. This is because you have only one match per row/column.

Why don't you do this?

Example (2).png

Add a variable in your table name like this:

let vPreviousForecast = '2 + 10';

let vLatestForecast = '3 + 9';

In your measure you enter this in the labels: 'Sales previous forecast ( ' & '$(vPreviousForecast' & ' )'

Same would be done for the latest forecast.

Jordy

Work smarter, not harder
etienne2
Contributor
Contributor
Author

Hi, thanks. Actually as i'm new to qlik and need some quick results visually, i pull as much as possible the data as is from the base and just make the layouts in qlik. I find it easier to then calculate variances etc at that level rather than in viz tool. Also, in past  i found necessary to have both this possibility to use the tall way of data design and the wide way as they're complementary when it comes to build visuals(at least that's how i used it in past tool).

Actually not sure this would match my requirements if i understand well. this is just a sample, but i  have many more scenarios and hence this is at database level that i define which one are the latest and the previous.