Forum Discussion
Chart data contains not a number (NaN) values
MarkCBB thanks for the detailed info. That will help. I have a new theory, and I've even managed to reproduce what you're describing with it:
Trendlines require that the axis be a numeric column, or at least one that can be treated as numeric like a date. If you've set up a drill-down hierarchy that includes something like a text-type column for Month or Quarter, that could cause the trendline to fail, except you're not on that drill level. If you're viewing it at the year or date level, the trendline can still calculate but you'll get the warning because when you drill down to a text level the trendline won't know what to do. In my testing I don't always get the warning at numeric levels, but I do get it when I drill to a text level like quarter. Does that sound like what you're seeing?
As for drilling to quarter and getting two year's worth, that's easy. You need a unique quarter per year. Your quarter column probably looks something like this:
Quarter
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
When you drill down to quarter you're telling the visual, "For each value of Quarter in my date table, calculate my measure." So it does. It gives you the measure for every date corresponding to Q1. That's two Q1s calculated together. This can be useful if, for instance, you want to know which quarter in general has tended to have the best sales, but it is not useful if you want to have a single year's quarterly sales. For that you need a column like this:
Quarter of Year
Q1 2015
Q2 2015
Q3 2015
Q4 2015
Q1 2016
Q2 2016
Q3 2016
Q4 2016
Same thing, by the way, for Month. My date table has four such columns, both Quarter and Quarter of Year, and both Month and Month of Year. That way I can see both multi-year aggregates for averaging measures and single-year aggregates for totals and such.
Another note on date table ranges: my usual practice is to start from January 1 of the earliest year in any data table, and end on December 31 of the third year after the latest in any data table. In my experience it's extremely optimistic to expect that any report will be used unchanged for more than 3 years. Either the report will be replaced with something else, or during some inevitable future revision the date range can be extended as necessary. Your mileage may vary, but there is probably some number of years that will suit this practice to your needs.
I have no idea about the color saturation thing. I'll have to do some testing. You say you're using Total Value as color saturation. I gather that's just a basic SUM measure? What are you using as the value measure for the chart? Like what's the measure you're using for column height?
Thank goodness for this thread. It has saved my sanity. I had the same NaN error message as MarkCBB on many stacked column charts in a large report. Nothing I tried would fix the issue. I could create identical charts to the ones displaying the error, and they had no error! The only solution appeared to be to recreate all the problem charts :-(.
So I follow Mark's lead and look for a trendline. But my charts have non-numerical X axes and the Trendline option didn't appear in the Analytics pane. But if I changed the chart to a line chart and changed the X axis to something numerical (I used the Date column from my date table), the Trendline option appeared, a trendline was indeed present, and deleting it, then reversing the X-axis and chart type changes fixed the issue.
Apparently, the person who initially created the charts (not me) added trendlines, but then changed the chart type and X-axis. So the trendline was hiding there all the time causing the NaN warning, even though it was not accessible in the Analytics pane. Very tricky.
- tiztrain7 years ago
Helper I
Oh my gosh! You are my hero. This is exactly my issue. Bloody disappearing Trendline option. Ha.
Cheers!
SteelBreeze wrote:Thank goodness for this thread. It has saved my sanity. I had the same NaN error message as MarkCBB on many stacked column charts in a large report. Nothing I tried would fix the issue. I could create identical charts to the ones displaying the error, and they had no error! The only solution appeared to be to recreate all the problem charts :-(.
So I follow Mark's lead and look for a trendline. But my charts have non-numerical X axes and the Trendline option didn't appear in the Analytics pane. But if I changed the chart to a line chart and changed the X axis to something numerical (I used the Date column from my date table), the Trendline option appeared, a trendline was indeed present, and deleting it, then reversing the X-axis and chart type changes fixed the issue.
Apparently, the person who initially created the charts (not me) added trendlines, but then changed the chart type and X-axis. So the trendline was hiding there all the time causing the NaN warning, even though it was not accessible in the Analytics pane. Very tricky.