on 2023 Mar 02 2:37 PM
Hello,
I have created an analytic application and has a table as displayed below
Here "INPUT AB" is a calculated measure.
I need a filter or input control-like feature that will help me to hide all rows that have a NULL value for the column "INPUT AB".
Is there any code snippet that I could use and filter the table as I needed?
Thank you
Request clarification before answering.
A very quick answer before I go to the pub 🙂 --- so more a starting point
1. I created a calculated measure: GM that displays 100 if the Gross Margin is < 10million
IF(["BestRunJuice_SampleModel":Gross_Margin]<10000000 ,100 )
............................if greater than 10mil it will return blanks/nulls
2. Create a Measure based dimension and add it to the table rows - GMDIM
This is a dimension that uses the values from the calculated measure GM above
I have a table like this below
The button contains the code:
Table_1.getDataSource().setDimensionFilter("31785582-6112-4744-9948-322815672548","0");
When clicked the table is filtered to only show the GMDIM rows = 0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello jbarlowjb
Thank you for the suggestion. This is my table
The script worked for dimension
Table_5.getDataSource().setDimensionFilter("SUPPLIER.Supplier_Code","22***"); // working
But it didn't work for measures. I tried the following
// INPUT AB = 27159717-6203-4541-9708-130721771612
Table_5.getDataSource().setDimensionFilter("27159717-6203-4541-9708-130721771612","10");
Table_5.getDataSource().setDimensionFilter("27159717-6203-4541-9708-130721771612",{from:"0.05"});
Table_5.getDataSource().setDimensionFilter("27159717-6203-4541-9708-130721771612",{greater:"5"});
Table_5.getDataSource().setDimensionFilter("18570737-5431-4606-b288-840336402033",{greater:"5"}); //infla
Any suggestions
Thanks again 🙂
Hi there,
From the above code sample , it looks like you're trying to apply multiple dimension filters on the same table?
i.e. filter on multiple values from the same dimension "27159717-6203-4541-9708-130721771612"
The first line of code should work
Table_5.getDataSource().setDimensionFilter("27159717-6203-4541-9708-130721771612","10");
Assuming you enter ctrl+space after the dimension name to open the member selector.
Is 27159717-6203-4541-9708-130721771612 definitely a measure Dimension?
jbarlowjbI use just a single code, the remaining are others that I tried
Table_5.getDataSource().setDimensionFilter("27159717-6203-4541-9708-130721771612","10");
also since this is a calculated measure I don't get the name with ctrl+space instead I use
var x = Table_5.getSelections();
console.log(x);
to get the id for measure
User | Count |
---|---|
75 | |
30 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.