How to write event/script on the rows and columns selected in pivot?
1.create a pivot with row, column, and aggregation
2.Here I have taken row as country, column as a month, and aggregation as the sum of price
3.To add script/event in a selected row, click on the setting icon available on the right of the row name
4.mark checkbox named 'script'. as you click on the script, the test span will open on the bottom side of the window
5.write your script here. I have written a script to change the tab and apply a filter of the country name clicked by the user. [ Find script in right side cell ]
6.click on eccept button and save it. go to preview and test script working.
Dashboard: pivot aggregation test Sample script: var a= '{{country}}' console.log(a); var tab = new CustomEvent("opnbi-change-tab", { "detail": 1 }); window.parent.dispatchEvent(tab); setTimeout(function(){ var filter = new CustomEvent("opnbi-filter-call", { "detail": {"country": a} }); window.parent.dispatchEvent(filter); });