cancel
Showing results for 
Search instead for 
Did you mean: 

How to take first value as default value in design studio through scripting

SATHISH_BTP
Participant
0 Kudos

Hi,

I am Working As a BO Consultant,Present I am working On Xcelsius dashboards have created Top 10 Customers client need Same dashboard in Design Studio I have Implemented but I am Facing Small Issue while doing this. My Question is once i run the dashboard based on  from and to date customers will update and same time materials need to update based on from and to date and on first  customer at Initial(Here want to take Hero moto corp at first time )after that based on selection in customers automatically materials will change by using Set filter,But how to take first customer to effect for Material at first initial running,Could you please help on this.

From Date 02.2014 to Date as Blank

customers             net value                                   materials             net value

Hero Moto Corp     1000000

Tvs Motocorp          200000

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

As a follow-up, it would also assist with providing further guidance if you could post a screenshot of the Xcelsius dashboard that you're trying to reproduce in Design Studio.

Thanks,

Mustafa.

SATHISH_BTP
Participant
0 Kudos

Hi,

In screen shot Automatically taken Fisrt Customer for material and monthly break up ,How to Implement this in design studio.

MustafaBensan
Active Contributor
0 Kudos

Hi Sathish,

Thanks for the screenshot.  Let me try to explain.  In your Xcelsius dashboard, you have the Top 10 customer table and the first row is always automatically in the selected state by default.  As a result, the filtering of the materials for the other connected charts is automatic.

However, in Design Studio, if you use a crosstab component to list your Top 10 customers, unlike the Xcelsius table, the first row is not in the selected state by default, so the onClick event is only triggered when a row is clicked.  As a result, on startup, the filter for the customer materials is not automatically triggered.  Therefore, as a workaround to this limitation, as I have described above, you need to create a separate query that returns ONLY THE TOP CUSTOMER.  This query should be assigned to a NEW DATA SOURCE in your Design Studio dashboard.  Then on startup, you need to apply the getMembers() method to this data source to retrieve the default top customer, which you then apply as a filter on the material data source.

Regards,

Mustafa.

Answers (1)

Answers (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Sathish,

This is one of the important differences between Xcelsius and Design Studio in terms of handling default selections.  I am assuming you have a Crosstab and you would like to set the first item as a default to influence the setFilter for the material on startup.  Is that right? 

One approach would be as follows:

1.  Define a separate query just to return the top customer, to use as the default;

2.  On startup apply the getMembers() method to this data source, to retrieve the top customer;

3.  Apply the setFiler on the material data source using this default top customer.

Regards,

Mustafa.

SATHISH_BTP
Participant
0 Kudos

Hi Mustaf,

Thanks for your Prompt Response,But need More Clarification I am getting Top 10 customers how to pass first value to effect for materials

Regard's,

Sathish

MustafaBensan
Active Contributor
0 Kudos

Hi Sathish,

The problem is that with your existing data source that returns the Top 10 customers, there is no way in Design Studio to just retrieve the first customer from that list via scripting.  If you try to apply the getMembers() method directly to the Top 10 data source result set, this function re-sorts in alphanumeric order, so you cannot just retrieve the first member as the top.  This is why you need to write a separate back-end query that returns only the TOP CUSTOMER, which is what you will use as the default.  You then apply the getMembers() method to the customer dimension on this new data source and it will return only the single top customer.  You then apply this default top customer to your setFilter() for the material data source.

Regards,

Mustafa.

SATHISH_BTP
Participant
0 Kudos

Hi Mustaf,

Thank You,I have Implemented for Xcelsius Dashboards the same Queries I have used Here will check your idea and let you know if face any issue.

MustafaBensan
Active Contributor
0 Kudos

Hi Sathish,

Just to be clear, for Design Studio, you will need to create a new query IN ADDITION to the ones you have defined for Xcelsius in order to retrieve the top customer as the default value.

Regards,

Mustafa.