cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Design Studio Conditional Formatting using Data Binding

Former Member
0 Kudos

Hello All

I am using a Text Box to display an Actual Value ( data bound to the data source). While applying conditional formatting using the same method I am unable to get the desired results if a target value is unavailable for a particular KPI

Below is a screenshot of the KPI tile

The conditional format logic is as below

if Target is available and Target > Value, number is Red

if Target is available and Target < Value, number is Green

if Target is unavailable, number is Grey

Below are the screenshots for the applied CSS and the data binding

I mapped another text box (TGT_PAGE2_OPS_PD_DP) to the Target cell for the KPI (data bound to the data source)

The KPI displayed above with a value of 11.41 has no Target available in the BEx query results.

The above logic sets the target variable as 0.0 instead of a blank string and hence applies Green colour instead of Grey (ContentNeutral)


I have looked at the below discussions, but none discusses a logic to handle unavailability of a target



We are using SAP Design Studio 1.5 and BEx query data source


Can anyone advise on how I can modify this logic?


Much appreciated


Regards,

Premdas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Premdas,

I can understand your scenario.

You should verify the data cell as undefined before applying conditional formatting. Also, Use get data from data source in this case instead of getText from Text component. It should help you.

Your script should be like,

var target = DS.getdata ( <your data selection goes here .. > ) .value;

if( target == ' ' || target === undefined ) {

css = 'contentNeutral' ;

}

I hope this helps.

Thanks,

Ganesh

Visual BI

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Premdas,

target_val is a measure? what is the data type of target_val (int, float, ...)?

Design studio can't convert null to int. Could you please check if there is some error messages (when you run the application)?

Regards,

Giulia

IngoH
Active Contributor
0 Kudos

Hello Premdas,

did you check how "null" values are being treated in the BEx query ? is the BEx query configured to show "null" as an actual "0" ?

regards

Ingo Hilgefort, Visual BI

Former Member
0 Kudos

Hi Ingo,

The "null" values are not shown as an actual "0", rather its shown as an empty cell (as shown in the below screenshot)

Regards,

Premdas