cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member330010
Participant
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

MustafaBensan
Active Contributor
0 Kudos

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.

former_member330010
Participant
0 Kudos

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?

former_member330010
Participant
0 Kudos

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

MustafaBensan
Active Contributor
0 Kudos

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?

former_member330010
Participant
0 Kudos

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.

MustafaBensan
Active Contributor
0 Kudos

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?

former_member330010
Participant
0 Kudos

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

MustafaBensan
Active Contributor
0 Kudos

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?

former_member330010
Participant
0 Kudos

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.

MustafaBensan
Active Contributor
0 Kudos

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.

former_member330010
Participant
0 Kudos

Thanks, this is all very helpful information, particularly the "On Data Change" recommendation. Let me give this a try and I will let you know.

Thanks again.

former_member330010
Participant
0 Kudos

Thanks, that did it. It is much easier doing it the right way the first time.