Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

wilsont3
New Contributor

Label Expression to display field value

I have a KPI that shows the forecast operating expenses for the current period based on a field named source.  I need a label that shows the forecast scenario (another field) for the values with a source of Current*.  The scenario today for the Current_ExpForecast is ForAug, and the label needs to dynamically update to ForSep when the new forecast is finalized and the data is updated in the db.

This is my KPI expression that works:    =Sum({<Source={"Current*"}>}GrossOpExp)

This is the label expression that is not correct:      ='Forecast (' &Scenario&')'         

The label now shows Forecast (), but I need it to show Forecast (ForAug).

Labels (1)
1 Solution

Accepted Solutions
bharathadde
Contributor II

Re: Label Expression to display field value

if doesn't work unless you make selections on a KPI box. 

Use

=Aggr(Scenario,Source='Current_ExpForecast')

View solution in original post

5 Replies
Yoshidaqlik
Contributor II

Re: Label Expression to display field value

Hi

if you have a date field you can use

='Forecast (' &Capitalize(DATE(MAX(Date_Dim),'MMM'))&')'   

Regards 

YoshidaQlik https://www.youtube.com/channel/UC1I9P8MqCZEhB6Nw3FdSqng
bharathadde
Contributor II

Re: Label Expression to display field value

 ='Forecast (' & Aggr(Scenario,Month = Max(Month) &')'    

or

 ='Forecast (' & Only({<Month={$(=max(Month)}Scenario) &')'    

Basically you need to calculate max or current value of Scenario since it has multiple values.

Highlighted
wilsont3
New Contributor

Re: Label Expression to display field value

I hoped to use a set expression to display the value of Scenario when the Source is Current.

Something like: =if(Source='Current_ExpForecast', Scenario) but this doesn't work.

bharathadde
Contributor II

Re: Label Expression to display field value

if doesn't work unless you make selections on a KPI box. 

Use

=Aggr(Scenario,Source='Current_ExpForecast')

View solution in original post

wilsont3
New Contributor

Re: Label Expression to display field value

This worked! Thank you very much

='Forecast ('&Aggr(Scenario,Source='Current_ExpForecast')&')'