Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Conditional num formatting

Hello,

I'm having an issue with conditional number formatting.  Whenever ACTUAL_CALCULATION is Rate, I want the result to be in a percentage, otherwise, I want the number rounded to 2 decimal places.

When the expression is evaluated, however, the 'Rates' are not coming back as percentages.  If I click on 1 record though, the format does correctly change to an percentage.

Is there something I'm doing wrong in my expression below?

if (ACTUAL_CALCULATION = 'Rate',num(Sum(NUMERATOR)/sum(DENOMINATOR),'#,###.00%'),

     if (ACTUAL_CALCULATION = 'Sum', num(sum(SUM),'#,##0.00'),

if (ACTUAL_CALCULATION = 'Median', num(Median(SUM),'#,##0.00'),
if (ACTUAL_CALCULATION = 'Formula', 0,0
)
)
)

   )

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I realized my mistake.  I had "Full Accumulation" mistakenly checked.  When I checked "No Accumulation", the expression worked.

View solution in original post

6 Replies
sunny_talwar

Have you selected 'Expression Default' on the Number's tab of the chart properties? If not select that and it should work

Peter_Cammaert
Partner - Champion III
Partner - Champion III

When complex setups suddenly start to work when you select a single item, this usually means that one of the components of your expression returns many values whenever two or more rows are active.

For example, how many values does field ACTUAL_CALCULATION contain when more than one record is active?

Anonymous
Not applicable
Author

Hello Sunny,

Yes, the format settings are set to Expression Default

Anonymous
Not applicable
Author

ACTUAL_CALCULATION contains four values: Formula, Median, Rate, and Sum.

If I filter on Rate the results of the expression give me a long decimal, seemingly ignoring the num function altogether.

sunny_talwar

Would it be possible to look at a sample where you have this issue?

Anonymous
Not applicable
Author

I realized my mistake.  I had "Full Accumulation" mistakenly checked.  When I checked "No Accumulation", the expression worked.