on 09-14-2021 7:55 AM
I have a date dimension in my model and need to display it as a dropdown.I have used the following code to get the members and display the data. But my dropdown looks weird. date-issue.pngSee attached. How can I see dates in the dropdown and not formats.Looks like I am doing something wrong in date format. Any guidance would be helpful.
var dates = Tbl_MarketPrice.getDataSource().getMembers("Date",10);
var l = 0; console.log(dates);
for(l=0;l<dates.length;l++)
{
DD_Date.addItem(dates[l].id);
}
Dear shilpa.banerjee,
your dropdown is only showing the IDs of your Date members.
You need to write your code like follows to show the description:
var dates = Tbl_MarketPrice.getDataSource().getMembers("Date",10);
var l = 0; console.log(dates);
for(l=0;l<dates.length;l++)
{
DD_Date.addItem(dates[l].id, dates[l].description);
}
Best regards
Susanne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why do you think, this is still not working?
What's your master data for dimension Date look like and what's your expected result?
The code adds the first 10 members of your Date dimension to your dropdown, showing the description. In case there is no description maintained the dropdown will show the ID.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
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.