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

How to change a numeric value to a percentage value in a numeric point chart in SAC?

SagnikSaha
Product and Topic Expert
Product and Topic Expert

Accepted Solutions (1)

Accepted Solutions (1)

Ivan_Camac
Participant

You could also just configure two separate measures. So have one calculated measure configured to show the value, and then another configured to show the value as a percentage. Then write a small script to place on a button or whatever input control you like that will toggle which measure is displayed in the numeric point chart.

Script to toggle would look something like:

// Define measure IDs
var measure1 = "77373615-5410-4254-3668-914452161766";
var measure2 = "19715775-8237-4549-3898-205003124717";

// Get the currently assigned measures
var currentMeasures = Chart_1.getMembers(Feed.ValueAxis);

// Check which measure is currently displayed and toggle
if (currentMeasures.includes(measure1)) {
    Chart_1.removeMember(Feed.ValueAxis, measure1);
    Chart_1.addMember(Feed.ValueAxis, measure2);
} else {
    Chart_1.removeMember(Feed.ValueAxis, measure2);
    Chart_1.addMember(Feed.ValueAxis, measure1);
}

Cheers, Ivan.

Answers (1)

Answers (1)

GiriRaaj
Product and Topic Expert
Product and Topic Expert

Hi,

This is very much possible. create a two widgets one with numeric and another one widget using %.

hide the % widget by default.  create a push button,in this push button write a script 'on click'  event.

widget2.visible = true. ( widget1.visible = false).

In this way you can control the widgets. Please note this can be achieved using : Optimized story experience mode only. meaning the latest recommended SAC Story. (which comes with advanced mode of scripting).

thanks with regards

Giri