Custom metric issue, eg. A-B when A dosn't exist it returns a value of -B | XM Community
Skip to main content

Hi All,
I have (or maybe now had) a problem with custom metrics. I am subtracting a field from another (eg. NPS - target). The targets are setup for each period for the whole year. As it's only September, the targets display for October, November and December but NPS is blank (it appears as a hyphen '-'), which is fine. the problem is that the custom metric that subtracts NPS from target still calculates so it's treating the blank '-' like a zero. I wondered how I could hide a custom metric if NPS was blank. Perhaps by some clever maths? My only slight thought is what if NPS is zero but let's not worry about that just yet!
I managed to get this working by using this formula in the custom metric
=(nps-target)-(nps/nps*0)
This seems to work but as mentioned what if the NPS calulates to be 0. Putting in a fiddle factor (eg.+ 0.0000000000001) might work but I guess I'll have to wait for a zero NPS.
Does anyone have any thoughts?

Thanks

Rod Pestell
image.png

Rod_Pestell Does it work if you add a filter to your NPS in the custom metric? The filter would be looking at NPS values 0-10.
Screen Shot 2021-11-12 at 8.37.37 AM.png


https://community.qualtrics.com/XMcommunity/discussion/comment/41824#Comment_41824Hi jmborzick ,

Thanks for the reply. Filtering NPS I don't think will work as NPS is available for each period. It's the target which doesn't occur for the Period 5,6,7 and 8. Your reply has spurred me on though to think about this further. The problem is that I am assuming the custom metic that calculates the variance will not show a figure for periods 5,6,7 and 8 when (in the widget) you add the row dimension using the Period field. However, it doesn't work as expected. it still shows / calulates a number. I'm not sure why this is but am wondering if it's something to do with using 'max'.
Anyway - with that thought, if I therefore go and add in a filter for Period in the custom metric (filter both parts of the formula for Period 9,10,11 and 12), it then works! The problem with this solution is that it's not dynamic and you have to go in and manually change that filter if eg. an ealier period then gets a target.

So to summarise I changed my custom metric from this:
NPS vs NPS Target chg (for Total Brand) = NPS [all hotels] - Max (Total Brand NPS Target)
to:
NPS vs NPS Target chg (for Total Brand) = NPS [all hotels & Period 9-12] - Max (Total Brand NPS Target [Period 9-12])

The widget then displays correctly:
image.pngYou can see that the 'NPS target' populated for P05, P06, P07 and P08 but in the data I imported does not contain targets for these periods. I can only assume that the it's something to do with the use of 'max' in the metric. The only other option I have is possible create a duplicate field in the dataset for this target field and tell it to be a text set rather than a number and then see if that stops it displaying but I don't think it will make any difference.

So the moral of this story/issue is that you have to double filter when you're trying to add and refer to alternate sources of data.

I look forward to the Merge task / option which is currently in preview as this might solve all the issues! :)

Thanks

Rod Pestell


Leave a Reply