Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
wilsont3
Contributor II
Contributor II

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
Creator II
Creator II

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
Creator II
Creator II

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
Creator II
Creator II

 ='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.

wilsont3
Contributor II
Contributor II
Author

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
Creator II
Creator II

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

Use

=Aggr(Scenario,Source='Current_ExpForecast')

wilsont3
Contributor II
Contributor II
Author

This worked! Thank you very much

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