Hi All....
I have a scorecard straight table where MetricId is my dimension. I want to format an expression as integer, percent or currency depending on the metricid. Here is a simplified test case I've been working with:
= if(MetricId=2, num(count(CRMRecType),'###,###,##0'),
If(MetricId=5,num(count(CRMRecType)/100,'#,##0.00%'),
If(MetricId=22,num(sum(OpportunityAmount),'$##,###,###'))))
Number format for this expression is set to "Expression Default".
My calculations are working correctly but the formatting is being ignored. Any one of these format statements by itself works correctly but when I put them together the formatting is ignored. What am I missing?
Thanks for any insight into this issue....
Martha
I suspect the if statement evaluates the expression and returns the evaluated value as a number, so the formatting is applied before and not after the if expression.
As a work around, you could try wrapping the num() statements with a text() statement. Then it is a text expression being evaluated.
I haven't tested this, so I can't be sure it will work. Give it a try and let us know.
Jonathan
How about using the money() function rather than num()?
Doesn't change the outcome -- still no formatting.
Looks right to me. Is the format being overridden on the Number tab? I'm guessing not, since you say each one works individually.
I selected "expression default" on the number tab.
Jonathan,
Wow, you figured it out. I added the text statement and it works! Thank you so much.
if (MetricId=2,text(num(count(CRMRecType),'###,###,##0')),
if
Community
QlikView Home Page