Top Rank Narrative error

Hi,

for the Top Rank Narrative, if system have 3 data can capture it will showed top3 data,
but if system only have 1 or 2 data, the insight will become errors.

does anyone know how to deal with this issue? Thanks.

1 Like

Hello @Chloe5, it looks like you will probably need 2 if statements here for each statement. Since the 2nd portion of your statement doesnโ€™t check if Top.items[2] exists, it errors when that value is not present. You would need to check if that value exists or is not equal to โ€˜N/Aโ€™, then return that item. Let me know if that helps!

Hi DylanM,
could you guide how to do it? Thanks.

Hello @Chloe5, so I think there is actually an easier way to accomplish this. You can try to keep it set up like it currently is where you determine each individual line by defining the index for each category value. I think what is preferred, is switching it to the Block For loop, then on a single bullet point writing something like this:
ifelse(Top.items[index].categoryValue.formattedValue = "N/A", "Vendor Driven Delay", concat(Top.items[index].categoryValue.formattedValue, " with ", Top.items[index].metricValue.formattedValue, " units"))

This will need to be in a single expression block, like the expression where you have Top.items[0].categoryValue.formattedValue = 'N/A'.

It would end up looking like this in the custom narrative editor:

This should get you to your desired solution! Let me know if you have any further questions.