Filters Controls not accessible on a dashboard

Hi Team,
I have created an analysis with filters and filter controls attached to it. I tried publishing the analysis to a dashboard, where I see some filter controls are fine , but some are showing error - “Filter attached to this control no longer applies to this sheet”. This happens when I am trying to do everything via Code , but if I manually publish the dashboard through QuickSight Console, there is no such inconsistency. Attached screenshot for reference-

Hi @Shreya,
I assume that since your Purchase ID control is working on the same sheet, you checked to confirm that the Event Type control is assigned to each visual on the sheet as well?

Were you able to spot any differences for your control that’s working from the one that isn’t in the JSON? I’d be interested to see how you have each of them setup to compare.

Additionally, I’ll include a post below that discusses the analysis template as an alternate way to explore:

I spot no difference between how they are configured , since both are of String type. The only difference is Event Type has 8 kinds of category values and PurchaseId has lot many(more than 1000).
Also, If the problem would have been in analysis then the dashboard created through console would have not worked.
But this problem arises only when dashboard gets created through code which first creates template out of this analysis and then creates the dashboard.
One point to add , even though PurchaseId is visible it doesn’t works i.e. it does not filters the data. Am I missing some filter configurations while creating the templates/dashboard?

Hi @Shreya,
Apologies on missing your last response. Were you able to find a work around for this instance or are you still encountering the same issue?
If still encountering, would you be able to share your bit of code where you are trying to account for the filters so that I can see what might be missing?