cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAC Application Designer Hide NULL Values

Former Member
0 Kudos
2,314

HI Experts,

I have created an SAC designer application. I have a scenario to hide the chart if the value is NULL. Is it possible to check the value of key figure and hide the full chart if there is no value to display? Can you please help with the syntax.

Accepted Solutions (1)

Accepted Solutions (1)

former_member542603
Participant
0 Kudos

Hi,

The below code will work.

//Long Version, onresultchanged of chart

if(Chart_1.getDatasource().isResultEmpty())

{

Chart_1.setVisible(false);

}

else

{

Chart_1.setVisible(true);

}
//Short version, onresultchanged of chart

Chart_1.setVisible(!Chart_1.getDatasource().isResultEmpty());

- Sathya

Former Member

Thanks Sathya, It worked 🙂

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi all,

I'm trying to use the getData() function, but I'm clearly missing something. Could you tell me, in the function getData({"@MeasureDimension":"35535223-8334-4717-a487-324737206791"}) where does the "35535223-8334-4717-a487-324737206791" come from?

Thanks,

Katarzyna

Former Member
0 Kudos

I also had a question on how to check value of a measure. Like I need to check the value of a measure 1, 2, 3 or 4 and hide a chart. I have a data source and on intialization I need to validate if the datasource measure value i need to setvisible or hidden.

Bob0001
Product and Topic Expert
Product and Topic Expert
0 Kudos

See Sanjay's comment above.

former_member411491
Active Participant
0 Kudos

Hi Rohit,

you can apply Sathya suggestion. I can give you second suggestion apply which suits your requirements in a better way.

it's easy if you can read the measure value from Numeric charts as well.

Measure id you will get from console.log(chart.getDataSource().getMeasures());

var i =ConvertUtils.stringToNumber(chart.getDataSource().getData({"@MeasureDimension":"35535223-8334-4717-a487-324737206791"}).formattedValue));

not i is the measure value in numeric. Based on the value of i you can write logic of set visibility.

Regards,

Sanjay Guha