on 2023 Jun 15 10:09 AM
Hi experts,
Following the "Best Practice: Filter Table and Chart Through Checkboxes (Multi-Selections)" in Help Portal, I successfully filtered Chart through multi-selections checkboxes in New Model, but it didn't work in Table.

I guess it may be due to the error in the “setMeasureFilter” script - The sample may be based on a classic model created because the first line of its script is to filter for Accounts (with data such as Discount/quantity, which are the Measures in new model).
I have tried 2 methods to solve this problem:
1) Change the first line to "Product" dimension or "Measures";

2) Change the Chart_1 into Table_1 'Chart_1. removeMeasure (CurrentMeasureFilterSelection [i], Feed. ValueAxis);', but the system displays [Table_ 1. has no removeMeasure function].

But they all failed.
How to write the scripts for checkboxes (multi-selections) to filter Table in New Model?
Request clarification before answering.
miss_who
see the below example of a measure based model. I have put the below script on the Refresh Button. It basically refreshes the table with the measure selected in the Measure lists.
var sel_measure = Measure_List.getSelectedKeys();
console.log(sel_measure);
var DS=Table_1.getDataSource();
DS.removeDimensionFilter(Alias.MeasureDimension);
DS.setDimensionFilter(Alias.MeasureDimension,sel_measure);

Hope this helps !!
Please upvote/accept if this helps.
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First you have to use removedimensionfilter(). then you have to use setdimensionfilter().
Regards,
Sourabh Paul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
miss_who
Try using the below
setDimensionFilter(dimension: string | DimensionInfo, member: string | string[] | MemberInfo JSON | MemberInfo[] JSON | MeasureInfo | MeasureInfo[] | TimeRange | TimeRange[] | FilterValue JSON | RangeFilterValue[] JSON): void
Sets a filter on the dimension.
Hope it helps
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.