Skip to Content
1

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

Apr 12, 2017 at 12:21 PM

264

avatar image

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

10 |10000 characters needed characters left characters exceeded

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.

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Etienne PASCAL Apr 13, 2017 at 05:22 AM
0

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


Show 22 Share
10 |10000 characters needed characters left characters exceeded

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.

0
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

0
In addition to my last post, OBJ_5 (month) and OBJ_1 (dates) are from the same data source.
0

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.

1

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.

untitled.png (6.5 kB)
0

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.

0

I'm using the SP2 version.

0

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

0
Show more comments

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.

0

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

onloadpage.png (27.5 kB)
initaview.png (55.0 kB)
outlinepanel.png (16.8 kB)
janmonth.png (26.9 kB)
febmonth.png (37.0 kB)
0

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.

0

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.

1

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

0

Hi Etienne,

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

Regards,

Mustafa.

0

Hi Mustafa,

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

Regards,

Etienne

0

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.

0

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

Regards,

Etienne

0

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

0

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.

1

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

1

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

Regards,

Mustafa.

0
Koen Hesters Apr 13, 2017 at 07:38 AM
1

Hi,

check out

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

for cascading filters

Grtz

Koen

Share
10 |10000 characters needed characters left characters exceeded
Etienne PASCAL Apr 13, 2017 at 08:08 AM
1

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

Share
10 |10000 characters needed characters left characters exceeded