Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
srujanaponnuru
Creator
Creator

converting number to percentage

hi

i have service and value fields in the load script.

in Service i have xyz, def and abc

value fields are 

0.0142126041170827 and 
0.0142126041170828
i want xyz and abc as perentages in the front end and def as number. 
 
Currently in the database all are numbers. 
 
i have tried using if(match and num(value,'#,##00%') as new filedname
but it didnt work
please suggest me how to convert
 
thanks.
Labels (1)
7 Replies
Taoufiq_Zarra

@srujanaponnuru  have you check

SET DecimalSep=','; 

in your database 0.0142126041170827 or 0,0142126041170827 ?

=Num(0.0142126041170827,'#,##00%') give for example :

Taoufiq_Zarra_0-1615192146346.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
srujanaponnuru
Creator
Creator
Author

i have 0.0142126041170827 in database. 

but if i give the formula hard coded in atext object , it is cobnverting

if i give in load script as Num(Service ,'#,##00%')  it is not working. 

Taoufiq_Zarra

@srujanaponnuru  can you share your set, this is my script and result :

Taoufiq_Zarra_0-1615194989511.png

 

the output:

Taoufiq_Zarra_1-1615195003456.png

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
PrashantSangle

can you provide some sample data with expected output..

 

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
srujanaponnuru
Creator
Creator
Author

hi

i have created a service and value from cross table. these two fields are not present in the database

for that service i have taken below :

xyz, def an abc an assigned few values to service. 

Tempdata:

crosstbale(service, value,7)

load

a,

b,

c,

d,

e,

f,

abc,

xyz,

def

from (lib.......xls)

crosstab1

Load*,

key,

if(match(Service,'xyz','def'),num(value,'#.##0,00%'),num(value,'#.##0,00')) as values

resident temp;

 

PrashantSangle

try below if

 

if(match(Service,'xyz','def'),num(value,'#.##0,00')&'%',num(value,'#.##0,00')) as values

or 

if(match(Service,'xyz','def'),num(value,'#.##0,00')/100&'%',num(value,'#.##0,00')) as values

Regards,

Prashant Sangle

 

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
srujanaponnuru
Creator
Creator
Author

hi,

if i write the below formula, the values are coming as in the database. No change at all

if(match(Service,'xyz','def'),num(value,'#.##0,00')&'%',num(value,'#.##0,00')) as values

 

if i write the below formula, the values are not converting to %. 

if(match(Service,'xyz','def'),num(value,'#.##0,00')/100&'%',num(value,'#.##0,00')) as values