2024 Jul 17 8:26 PM - edited 2024 Jul 17 8:58 PM
Hi Experts,
We have a scenario for one our story where we would like to filter only on Version with Property ( Start_Period) which has date values in it.
Example: Version Dimension
We have story which we need to display with the only column with:
We are trying to fix story filter with Date and Version Property (Start_Period) and getting an error while running the button with the below script.
var selections = Table_1.getDataSource().getDataSelections();
var member = PlanningModel_1.getMember("Version",selections[0]["Version"]);
var prop = member.properties;
var planning = Table_1.getPlanning();
var SM1 = prop["Start_Period"];
var dateparam = "[Date].[FYP].&[" +SM1+ "]";
//Table_1.getDataSource().setDimensionFilter("Date","[Date].[FYP].&[202401]");
Table_1.getDataSource().setDimensionFilter("Date",dateparam);
There are no errors in script, however when we run Button it throws an error as below:
Please advise.
Regards,
Ram
Request clarification before answering.
try to add an InputControl selector with Version to your page and use following code
var selected_version = InputControl_1.getInputControlDataSource().getActiveSelectedMembersWithUnbooked().values().next().value.id;
var ver = PlanningModel_1.getMember("Version", selected_version);
if (ver){
if (ver.properties.Start_Period){
var dateparam = "[Date].[FYP].&[" +ver.properties.Start_Period + "]";
Table_1.getDataSource().setDimensionFilter("Date",dateparam);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Could you please send in the console those informations to check what's wrong ?
console.log(selections);
console.log(member);
console.log(prop);
console.log(dateparam);
Put these lines bevore the line with setdimensionfilter. Then, go in Devtool (F12) and give a printscreen of what the console.log returns in the Information register of the console
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
21 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.