cancel
Showing results for 
Search instead for 
Did you mean: 

How to get B dimension data after filtering it from A dimension Design Studio Universe Data Source

Former Member

Hello everyone,

I'm trying to get a filtered data source from a universe data source. I have a dropdown containing month items and when choose one of those month, the crosstab updates and show me only the data linked to the month.

Now what I want to get is only the data from this filtered data. However, When i use the getMembers() function, it gives all the data from my source and not only from the filtered crosstab data source.

So if you guys, have any idea, please help.

Regards

Etienne PASCAL

MustafaBensan
Active Contributor
0 Kudos

Hi Etienne,

It would be helpful if you posted a screenshot showing the Dropdown as well as the Crosstab, with an explanation of which dimension you are trying to access via getMembers().

Regards,

Mustafa.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thank you for replying.

As you can see in the code below, I'm filtering a universe data source by the OBJ_1 which is corresponding to label month. What I want do get are the members from this filtered data.

SOURCE_1.setFilters("OBJ_1",DROPDOWN.getselectedValue());

var myDates = SOURCE_1.getMembers("OBJ_1", 1000000000);
var len = myDates.length;
var lastDate = myDates[len-1];
TEXT_1.setText(lastDate.text);

However, when I look at what's behind the data after filtering it, I get all the data source and not only the filtered one. My intension is to get the last date data from the month I've selected in the dropdown.

So if you have any idea, I'll be pleased to get some.

Regards,

Etienne


MustafaBensan
Active Contributor
0 Kudos

Hi Etienne,

Thanks for the update, although I'm a little bit confused. You've mentioned that OBJ_1 is "month" but that you want to get the filtered dates, yet your getMembers() is also referencing OBJ_1. Did you intend to specify another dimension in getMembers() ?

Regards,

Mustafa.

Former Member
0 Kudos
In addition to my last post, OBJ_5 (month) and OBJ_1 (dates) are from the same data source.
Former Member
0 Kudos
DATA_SOURCE_FOR_CROSSTAB.setFilter("OBJ_5",DROPDOWN_MONTH.getSelectedValue());
var data = CROSSTAB_2.getDataSource();
var myDates = data.getMembers("OBJ_1", 1000000000);
var len = myDates.length;
var lastDate = myDates[len-1];
APPLICATION.alert(lastDate.text);<br>

Hi Mustafa

I'm filtering the universe data by month (OBJ_5), so when I check the crosstab, it updates as I want it and shows me only the dates correponding the the month I selected. That month is by default April. Thus it alerts me the last date of April.

However, when I change the month from my dropdown box, the crosstab updates as I excecpted but, the app alerts me the same date, April last date. That's why I think that when I filter the data source and want to get that one, it returns the global data and not the filtered.

So is there a way to get only the filtered data? Like a method named getFilteredDataSource(). It could be so usefull.

Regards,

Etienne

MustafaBensan
Active Contributor

Okay, thanks Etienne. That's clearer now. Some points to consider:

1) Have you set the Members for Filtering option of the dimensions OBJ_5 and OBJ_1 to "Posted Values Only" in the initial view of the data source? This setting is what triggers cascading filters. However, issues have been reported with the cascading filter functionality for Universe data sources. By the way, what version of Design Studio are you running?

2) Even if you get the cascading filter to work, there is no guarantee that getMembers() will return the dates in ascending order as the sort order on members is not tied to the sort order of the data result set. Anyway, first things first. If you can confirm about the Members for Filtering setting we can proceed accordingly.

Former Member
0 Kudos

Thank you Mustafa for replying,

I'm using SAP BO DS 1.6, I believe that's the last version, and when I edit the initial view of my data source, there is no option as you can see on the screeshot below untitled.png, maybe because I'm using a Universe data source and not a Bex.

MustafaBensan
Active Contributor
0 Kudos

And which SP version of DS 1.6 are you on? This is relevant because the cascading filter support for Universe data sources wasn't introduced until DS 1.6 SP2 if I remember correctly.

Former Member
0 Kudos

I'm using the SP2 version.

MustafaBensan
Active Contributor
0 Kudos

That could be on the borderline for when universe cascading filter support was introduced. Can you possibly upgrade to the latest version?

Former Member
0 Kudos

Hi Mustafa,

Sorry for being late at responding to your comment, I've been busy.

So I've upgrated my Design Studio to 1.6 SP4 and now I've the members for filtering option on setting data source initial view. However I still can't get the filtered data from my crosstab, so when I try to get the last data from the crosstab, it returns last date in the global data source.

Is there something I've forgotten?

Regards,

Etienne

MustafaBensan
Active Contributor
0 Kudos

Hi Etienne,

Just so I have a complete picture, can you provide screenshots of the following?

1) Your application in the browser, showing the expanded Dropdown and the Crosstab

2) The data source initial view

3) The Design Studio IDE Outline Panel

Thanks,

Mustafa.

Former Member
0 Kudos

Hello Mustafa,

These the screenshots you asked me.

The following code is the code that I use when the user select a month using the dropdown.

DS_1.setFilter("OBJ_5", DROPDOWN_1.getSelectedValue());

var data = CROSSTAB_1.getDataSource().getMembers("OBJ_1", 31);
var string = "";
data.forEach(function(element, index) {
  string = string + element.text+ ",\n";
});
var res = string.split(",");
var len = res.length;
APPLICATION.alert("Resultat :"+res[len-2]+"\n String \n"+string+"\n");
TEXT_1.setText(string);
//APPLICATION.log(res[len-2]);

As you can see when I select a month like Jan or Feb, it returns the same string. Indeed, when I run the app on the BI Platform, the filter on month runs well on the crosstab view but when I try to get filtered data on the var string it returns me the global data as I said above.

So if you now a way to get directly for instance the line of the crosstab, I'll be pleased to know or any solution.

Thanks,

Etienne

outlinepanel.pngjanmonth.pngfebmonth.png

onloadpage.png

initaview.png

MustafaBensan
Active Contributor
0 Kudos

Hi Etienne,

Thanks for the details. Your issue is clear now. To make it easier to determine the cause, let's try to simplify your application first. Can you make a copy of it and then apply the following changes?

1. Delete component DROPDOWN_1;

2. Add a Dimension Filter component, DIMENSION_FILTER_1;

3. In the Data Binding properties of DIMENSION_FILTER_1 assign DS_1 as the Data Source and "OBJ_5" as the Dimension;

4. In the "On Apply" event script of DIMENSION_FILTER_1, specify the following code:

var filteredDates = DS_1.getMembers("OBJ_1", 100);
var lastDate = filteredDates.pop();

TEXT_1.setText(lastDate.text);<br>

5. Execute the application;

6. From the Dimension Filter select a month and apply;

7. Confirm if the text field value corresponds to the last date shown in the Crosstab.

Regards,

Mustafa.

MustafaBensan
Active Contributor

Hi Etienne,

On further thought, we can retain the structure of your original application and apply only the following changes:

1. Bind Data Source DS_1 to the Items of component DROPDOWN_1;

2. In the Source Properties of the Items binding of DROPDOWN_1, set Data Source to DS_1 and Dimension to "OBJ_5". Also set the Target Data Source to DS_1 and the target Dimension to "OBJ_5";

3. In the "On Select" event script of DROPDOWN_1, specify the following code only:

var filteredDates = DS_1.getMembers("OBJ_1", 100);
var lastDate = filteredDates.pop();
TEXT_1.setText(lastDate.text);

4. Execute the application;

5. Select a month from DROPDOWN_1;

6. Confirm if TEXT_1 displays the last date shown in CROSSTAB_1.

Regards,

Mustafa.

Former Member
0 Kudos

Thank you Mustafa,

I'll do what you've proposed me, but I would to ask you before doing it, if you know if it could cause some problems if my Design Studio Tool is upgraded to the last version (1.6 SP4) and the Design Runtime still the last version. If so, how can I upgrade also the Design Runtime and also get the version of it?

I'll keep you in touch when I finish trying your suggestions.

Regards

Etienne

Former Member
0 Kudos

Hi Mustafa,

I've tried both of the solutions you suggested me, and unfortunetly none of them worked.

Regards,

Etienne

MustafaBensan
Active Contributor
0 Kudos

Hi Etienne,

What do you mean by "Design Runtime"? Are you referring to the Design Studio BIP Add-on for BusinessObjects?

Regards,

Mustafa.

MustafaBensan
Active Contributor
0 Kudos

Hi Etienne,

It seems to me that there is an issue with cascading filters for Universe data sources in your case. I tested both of the examples with a BW BEx Query data source and they worked as expected.

At this point I can only suggest 2 options:

1) Open an SAP Support Ticket

2) Use the Design Studio 1.6 SDK Data Iterator Component to get the last row in the filtered data source. This will definitely correspond to the Crosstab.

Regards,

Mustafa.

Former Member
0 Kudos

Thank you for all Mustafa, I'll keep seeking for a solution.

Regards,

Etienne

Former Member
0 Kudos

Hi Mustafa,

I've finally the solution to get access to the filtered data. The problem was the fact my the version of my Design Studio Runtime on BI Platform was older than the application that I've upgraded. So now I can get it.

However, there is a new issue that I can't explain. when i get the dates from the crosstab data, they're not keeping the sorting properties that I specified in the initial view. So do you know where the problem comes from?

Regards,

Etienne

MustafaBensan
Active Contributor

Hi Etienne,

Good to hear your filtering issue is resolved. Your new issue is a known limitation of the getMembers() function whereby the sort order is based on the master data order and not the data source order. You could try changing the sort order in the Universe definition itself.

Regards,

Mustafa.

Former Member

Hi Mustafa,

I really want to thank for all you've done to try to help. Now i got what I wanted so far. I did what you told me, directly

changing the sort order in the Universe definition itself, and it works so well.

Regards

Etienne

MustafaBensan
Active Contributor
0 Kudos

I'm happy to be of help, Etienne. Thanks for confirming it's all working as desired now.

Regards,

Mustafa.

Answers (2)

Answers (2)

Former Member

Hi Koen,

I've seen this video before but it doesn't give what I want to get. My main question is to know there is a way to get filtered data source? because when I use the getDataSource() method , it returns all the data from my source and not only the data that I filtered.

DATA_SOURCE_FOR_CROSSTAB.setFilter("OBJ_5",DROPDOWN_MONTH.getSelectedValue());
var data = CROSSTAB_2.getDataSource();
var myDates = data.getMembers("OBJ_1", 1000000000);
var len = myDates.length;
var lastDate = myDates[len-1];
APPLICATION.alert(lastDate.text);

Here the variable data always returns all CROSSTAB data and not the filtered one. For exemple my last month in dropdown box is April, so when I run the app it return the last date of April. However, when I change the month, for instance January , the crosstab shows the data linked to January but the last date still the same and the app doesn't get the last date of January ; it returns April's last date and it's the same for all the months in my dropdown box

Etienne

kohesco
Active Contributor

Hi,

check out

https://www.youtube.com/watch?v=t1UTWCZ77ag

for cascading filters

Grtz

Koen