Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have a field

I need to show % at end of values like (0.21)%. i set it in Number properties, also used num(Expression,'#.##0,00%') but its not working ,any expression level script or properties to change?
Regards
Amsi,
Try this:
if([Field (%)]/100>0,if([Field (%)]/100<1, '(' & num([Field (%)]/100,'#0.00%') & ')',if([Field (%)]/100>1,num([Field (%)]/100,'#0.00%'))),'0.00%')
Best regards
only 0% is showing and other values like (0.20) are missing.

Actual fields are below

Aside,from the QVW, there is something you're not showing/telling us.
What is the expression in column 'field'?
Hi,
use Isnull() or len(trim(fieldName))>0 then perform expression given by anlonghi2.
Try like
if(not isnull(Field (%)]/100 or len(trim(Field (%)]/100))>0,
if([Field (%)]/100>0,if([Field (%)]/100<1, '(' & num([Field (%)]/100,'#0.00%') & ')',if([Field (%)]/100>1,num([Field (%)]/100,'#0.00%'))),'0.00%')
)
Regards
this is the full expression
=if([Competitive (%)]/100<=0,0,
if([Competitive (%)]/100<1, '(' & [Competitive (%)]/100 & ')',
if([Competitive (%)]/100>1, [Competitive (%)]/100)))
Change your expression to
=[Competitive (%)] / 100
And set the format to
0.00%;(0.00%)
and make sure the Decimal Separator is set to .
Or use a Num() in the expression:
=Num([Competitive (%)] / 100, '0.00%;(0.00%)', '.')
HTH
Jonathan
All our efforts will never produce your required results. Your expression does the following:
If field <= 0, then 0 (never negative results)
else if field < 1 then put parentheses around the result and the % goes outside the parentheses
else if field > 1 then display as usual.
Indeed, this cannot be done with just the Format Pattern or any num() function parameters.
=if(isnum([Competitive (%)]),
if([Competitive (%)]/100>0,
if([Competitive (%)]/100<1, '(' & num([Competitive (%)]/100,'#0.00%') & ')',
if([Competitive (%)]/100>1,num([Competitive (%)]/100,'#0.00%'))),'0.00%'),'0.00%')
regards
=if([Field (%)]/100<=0,0,
if([Field(%)]/100<1, '(' &[Field(%)]/100& ')',
if([Field(%)]/100>1,[Field(%)]/100))) & If(Len(Trim([Field (%)]))>0,'%')
This worked for me.
=if([Field (%)]/100<=0,0,
if([Field(%)]/100<1, '(' &[Field(%)]/100 ')' & '%',
if([Field(%)]/100>1,[Field(%)]/100)))