cancel
Showing results for 
Search instead for 
Did you mean: 

Multiplication using scrip in design studio

Former Member
0 Kudos

Hello,

I am using design studio 1.6 SP4 Patch 1 to create a dashboard where my initial view has already the number using a division formula over there, to the number is in this format: "X.XX" and I want to show it as "XX.XX%". I tried to use percentage share formula but the view collapses (I am using a hana view):

1.png

So what i did is that i created a script like this, jusy to multiply it by 100 to get the percentage and then I add a global scrip with this sign %:

2.png

3.png

This script work with other dashboard but here it doesn't work. How can I change from float to string?

Accepted Solutions (1)

Accepted Solutions (1)

former_member276213
Active Participant
0 Kudos

Hi Alejandra,

I agree with your script with first 4 lines and i want you to add this in the start up script instead of writing this in formatter function based on performance stand point.

You can write first four lines of the script as it is in the start up instead of writing it in the text formmatter function (remove 5,6 and 7 script lines)

then you can add below piece of code to display the values as required.

TEXT_5.setText(Convert.floatToString(multi,"0.00")+ " %" );

Out put will be as shown in the screen shot from one of my design studioreport.

Feel free to let me know if you have any further questions.

BR,

Lakshmikanth Adharapurapu

percentage-screenshot.png

Answers (2)

Answers (2)

former_member276213
Active Participant
0 Kudos

one more point...you need to add this script in all the places to refelect on top of start up script if you are using drop down filters or any onselect conditions.

BR,

Lakshmikanth

kohesco
Active Contributor
0 Kudos

Hi,

you can set a formmatedvalue via formatterfunction --> compontent properties -> display --> source --> bound to DS -> Formatter function:

script your function like

var int = Convert.stringToInt(formattedValue);
int = int * 100;
return int + " %";