Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Suppressing NaN on Crosstabs
EricHougen
I have a cross tab report that does some math that occassionally results in division by zero. So I get NaN on the cross tab. Is there a way to suppress this? I'm attaching images showing the result, plus the aggregation from where the NaN originates. I'm in 2.3 but going to 2.5 shortly.
Find more posts tagged with
Comments
EricHougen
I'm posting my own solution. I found this in Chapter 14 - Writing Expressions of the Birt Field Guide to Reporting....
x=data["compliant_Group1/custom002_Group2/month"]/data["proposal_phase_Group1/custom002_Group2/month"] +" "
x.replace("NaN","Undefined")
This is supposed to convert the numerical data to text and then replace the text string of NaN with Undefined. Instead I get no value on the cross tab and a binding error which I havent figured out yet. Anybody got any suggestions or improvements?
fwhorton
Can you check for zero?
isNaN(data["proposal_phase_Group1/custom002_Group2/month"]) ? 0.00 : data["compliant_Group1/custom002_Group2/month"]/data["proposal_phase_Group1/custom002_Group2/month"]
or
data["proposal_phase_Group1/custom002_Group2/month"] == null ? 0.00 : data["compliant_Group1/custom002_Group2/month"]/data["proposal_phase_Group1/custom002_Group2/month"]
mwilliams
Another thing you could probably do would be to use mapping to replace the NaN values.
EricHougen
Thanks fwhorton. I checked for zero in the way you described. Looks much better now.