Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
prma7799
Master III
Master III

need help

Hi all,

Am using one formula into text object and output is coming 0.0092228146015614 and -11.881221060977

So I want output like 0.9% and -11.9%

Can you please tell me how to achieve it.

Thanks

1 Solution

Accepted Solutions
sushil353
Master II
Master II

Hi,

Use NUM function as Num(Sales,'#,##0.00%')

HTH

sushil

View solution in original post

8 Replies
sushil353
Master II
Master II

Hi,

Use NUM function as Num(Sales,'#,##0.00%')

HTH

sushil

PrashantSangle

Hi,

Try like

If(expression>0,expression*100,expression)& ' %'

Regards,

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 🙂
Anonymous
Not applicable

you can format using num function

num(your expression,'#0.0')

jonathandienst
Partner - Champion III
Partner - Champion III

Num(Sales,'0.0%')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable

For first expression you need to use if condition along with Num (),

=Num(if(num(0.0092228146015614,'#.##')<.1,num(0.0092228146015614,'#.##')*100,0.0092228146015614),'##.#')

for second you can directly use Num()

= Num(-11.881221060977,'#.#')

Thanks

BKC

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Your request is quite difficult to accomplish. When using the num function with a format string that contains a percentage mark you will get an implicit multiplication by 100. For example:

0 -> 0%

0.5 -> 50%

1 -> 100%

num(0.009, '0.0%') will produce 0.9% as required. But num(-11.88, '0.0%') will produce... er -1188% and not -11.9%.

Isn't that what you want?

Peter

PrashantSangle

Hi

For rounding you can try

Num(If(expression>0,expression*100,expression),'#,#0.0')& ' %'

regards

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 🙂
Anonymous
Not applicable

replace hard coded values with expression