Can we create Top Ranked narrrative based on multi categories?

what i want to show in insight narrative is the top 3 reason code for each Biz family. is it doable?

Hello @fanniew, my thought is that you could maybe use a sumOver() calculated field that would be partitioned by reason_code and Biz Family. Something like this:
sumOver({case}, [{reason_code}, {Biz Family}], PRE_AGG)

And use that as the value inside of the field well for your narrative function. I think the easiest solution though will be to create an insight for each Biz family to show the top 3 legal_po_ids. I hope this helps!

1 Like

Hello @fanniew, did the solution I suggested help you resolve your QuickSight question? If so feel free to mark my response as the solution or send a follow-up question so I can try to guide you further!

1 Like

thank you for the reply. Dylan. I decide to list top 3 per Biz family as below. but i have another query to manage top 3 detail. would you please give me further support?


image
how can I show as " OK2S/Launch related with 38 cases" ? if case<=1, show “case”, otherwise show “cases” . i fail to add IF in the FOR block.

Hello @fanniew, you could utilize an If statement after your “with Top.items[index].metricValue.formattedValue” statement. One thing to make sure of though, you will need to check the value and not the formattedValue since the formattedValue will return a string. You will need one If statement for each option, they would look like this:
If Top.items[index].metricValue.value > 1 cases
If Top.items[index].metricValue.value <= 1 case

That should give you the solution you are looking for!

1 Like

Hi Dylan

thank you very much for the guidance. it works now.

2 Likes