cancel
Showing results for 
Search instead for 
Did you mean: 

Read properties of dimension member

stefan_voltz1
Explorer
0 Kudos
905

Hello there,

I seem to have a simple and basic question. How do I read a specific property of a given dimension member? Please see the screenshot. I have a dimension "FMEPACKAGE" which has the property "Category". By looping through the packages I want to add those packages to a dropdown list which have the selected category in their property.

In the variable "packages" there is no option to read the properties. What am I doing wrong?

Thanks and regards!

Stefan

View Entire Topic
N1kh1l
Active Contributor
0 Kudos

stefan.voltz1

getmembers() of datasource does not expose the attributes, that is why you are not able to check its value. If your model is planning model you can use getmember of Planning Model.

var members1=PlanningModel_1.getMembers("SAP_CEP_PRODUCT",{limit:1000}); // Replace with your dim
for(var counter1=0;counter1<members1.length; counter1++) 
{ if(members1[counter1].properties.BRAND===sel_brand ) // BRAND is attribute, replace accordingly
	{var filtered_member=members1[counter1];
	 members.push(filtered_member.id);
		
	}

}

Hope this helps !!

Nikhil

lllbidgelll
Explorer
0 Kudos
Hello @N1kh1l,
lllbidgelll
Explorer
0 Kudos
Hello @N1kh1l, Im trying to replicate the code that you shared, just wondering what is declared or where is the declaration for sel_brand please? thanks!
N1kh1l
Active Contributor
Hi, sel_brand is the Brand selected from dropdown. For e.g If I had a dropdown with brands A, B and C, I select A I want the other dropdown to only show products which belong to this brand.
lllbidgelll
Explorer
0 Kudos
@N1kh1l Thanks for the reply. Actually I have a situation where in when I try to select a record from the dropdown, it should get the property value of the dimension then display it on a input field - my current code doesn't have an error but it doesn't seem to work as intended. see my code: var sel = Dropdown_1.getSelectedKey(); var assetclass2 = PlanningModel_1.getMember("D_ASSET",sel).properties["D_ASSET.D_ASSETCLASS2"]; InputField_1.setEditable(true); InputField_1.setValue(assetclass2); where do you think i went wrong? thanks in advance!