Skip to Content
0

Multiplication using scrip in design studio

Apr 11, 2017 at 02:09 PM

124

avatar image
Former Member

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?

1.png (23.6 kB)
2.png (31.7 kB)
3.png (5.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Lakshmikanth Adharapurapu Apr 11, 2017 at 09:00 PM
0

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


Share
10 |10000 characters needed characters left characters exceeded
Koen Hesters Apr 11, 2017 at 02:15 PM
0

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 + " %";
Share
10 |10000 characters needed characters left characters exceeded
Lakshmikanth Adharapurapu Apr 11, 2017 at 09:03 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded