Skip to Content
0

SAP Design Studio Filtered Data source returning different number of rows.

Jun 08, 2017 at 01:57 PM

86

avatar image
Former Member

Not sure why but in this code the data source is returning different number of rows.

DS_EXCEPTIONS.setFilter("ZKPICATC2", CHART_1.getSelectedMember("ZKPICATC2"));
DS_EXCEPTIONS.setFilter(RangeType, CHART_1.getSelectedMember(RangeType));

var exceptions1 = DS_EXCEPTIONS.getMembers("ZKPICH31", 50);
var exceptions2 = DS_EXCEPTIONS.getMembers("ZKPICH32", 50);
var exceptions3 = DS_EXCEPTIONS.getMembers("ZKPICH33", 50);
var exceptions4 = DS_EXCEPTIONS.getMembers("ZKPICH34", 50);

APPLICATION.log(Convert.floatToString(exceptions1.length) + '-' + Convert.floatToString(exceptions2.length ) + '-' + Convert.floatToString(exceptions3.length) + '-' + Convert.floatToString(exceptions4.length));

So exceptions1 returns 8 rows and exceptions2-3-4 all return 3 rows. They all contain different data and they all contain data, so it is not because it is aggregating. The data source is BW.

Thanks for your help.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Mustafa Bensan Jun 08, 2017 at 02:46 PM
0

Hi Justin,

For easier analysis of your issue, it would be helpful if you posted a screenshot of your application, showing the chart, highlighting the selection and then also showing the filtered results with all four exception dimensions displayed in a Crosstab, as well as an explanation of how the RangeType variable is populated.

Normally, with a cascading filter setup, I would expect a result more along the lines of Exceptions 1, 3 and 4 returning the same number of items, since Exception 2 is used as one of the filters. It's possible that the returned member values are out of sync because the Members for Filtering attribute of each of the Exception dimensions as well as RangeType dimension have not been set consistently. Please check in your data source initial view editor that each of these dimensions has the said attribute set to "Values in Posted Data Only".

Regards,

Mustafa.

Show 11 Share
10 |10000 characters needed characters left characters exceeded
Former Member

It was aggregating. I just now saw that. I had changed the data in the database but forgot to delete the PSA before I ran the DTP and thought it was the updated data. Sorry, however the brings up a different question. is there a way to tell the data source not to aggregate?

0
Former Member

I see now it was aggregating. That brings up a different question. Is there a way to tell a data source not to aggregating?

0

Can you clarify the result you expect by not aggregating? Are you expecting to see individual line item rows with the same dimension member value combinations?

0
Former Member

Sure, so Exception1, Exception2, Exception3, Exception4 are one line of a long text. In BW 7.2 the largest data is 60 as you probably already know. So that is why I have to concatenate them. Sometime they are blank or duplicate causing the issue with aggregation.

0

Thanks for the clarification, Justin. So by executing getMembers() on each of the Exception dimensions, is your intention to iterate through the members and build a single concatenated Long Text line for each row and then display these in several text components?

0
Former Member
Mustafa Bensan

Yes, exactly. I have tried to use the dataiterator SCN extension but it created another issue.

0

The problem with using getMembers() is that there is no guarantee that the exception dimension members in a single row will line up. I would have recommended the SCN Data Iterator too. What issue did you run into with it?

0
Former Member
Mustafa Bensan

SCN Dataiterator does not work well with filters unless you add a timer. When I use it I get data from the last time I filtered or all the rows with no filter applied at all. Even when I add a timer to it, it still done not work. Plus this KPI is getting slow because of all the timers I have to add for the dataiterator to work. I think I will just add data to all fields that way I always get the same number of rows. But please let me know if you have any other ideas?

Thanks for your help.

0

HI Justin,

You should not have to add a Timer Component for the Data Iterator to work. Where have you placed your script code for iterating through the data? The code should be placed in the "On Data Change" event script of the Data Iterator.

Adding data to all fields so that getMembers() returns the same number of rows will not necessarily solve your problem. As I mentioned before, getMembers() does not return the list of values in the same order as the data result set as would appear in a Crosstab. Therefore, there is no guarantee that your exception dimension member values will "line up" for each row.

Regards,

Mustafa.

0
Show more comments