cancel
Showing results for 
Search instead for 
Did you mean: 

Error when selecting Overall Result line on a crosstab in Design Studio 1.5

Former Member
0 Kudos

Hi dear community members.

I have been trying to find a solution for this error I am facing in DS 1.5. Our users want to see as top line of a crosstab the overall result - added at the dimension in the datasource populating the crosstab. But when we click (On Select) on this overall result line, it generates a serious dump.

I am trying to make this first line 'unselectable' in order to avoid the issue, but unfortunately without success. Do you have an idea on how I could fix this?

Your help will be very much appreciated,!!!

Nataly

Here is a snap-shot of the first line giving me troubles (the one highlighted in yellow). Sorry for the quality, needed to hide the amounts...

And here is the result once this Overall Result line is selected. It occurs UNIQUELY when this result line is selected. When selecting the lines with values from the datasource (BEx query), the filter is properly applied, no errors.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nathalie,


The value of the total result is "(ALL_MEMBERS)". Since there is no such value in your data source, issue might occur.

So you can try to add a if-clause as below.


if (CROSSTAB_1.getSelectedMember("Client").internalKey!="(ALL_MEMBERS)") {

  if_statements

}

Best,

Alfred

Former Member
0 Kudos

Hi Nathalie,

I have come across the same issue lately.

Actually, the .getSelectedMember cannot be called when the total row is selected, because the total row is not considered as a member. You first have to use .getSelection() to be sure that a member is selected and not a total row.

For example:


var sDimension="0CUSTOMER";

var aSelection=me.getSelection()[sDimension];

var sSelection="";

if(aSelection!==undefined&&aSelection.length>0){

  sSelection=me.getSelection()[sDimension][0];

}

if(sSelection!==""&&sSelection!=="(ALL_MEMBERS)"&&sSelection!=="(RESULT_MEMBER)"){

     // here you can safely call .getSelectedMember()

}else{

     // handle no selection, all members selected, or result line selected

}

The code above makes sure a real member of the 0CUSTOMER dimension has been selected in the crosstab. You can change the 0CUSTOMER to any dimension in the datasource; the rest of the code can stay as is.

Hope it helps,

Tanguy

Former Member
0 Kudos

Hi,

Sorry, it was a typo. It should be "Result".

Best,

Alfred

Former Member
0 Kudos

Hi Alfred,

I'm really surprised, your code dumps on 1.5 SP2.

What version are you using?

Tanguy

Former Member
0 Kudos

Thank you very much Alfred!!

Former Member
0 Kudos

Tanguy,

I used your code and adapted for my dataset and it worked at first try! Thanks so much! I will try Alfred's and Gowtham suggestions in other scripts (which are basically the same).

I did not know that by selecting the result line, it was selecting in fact, NOTHING, or ALLMEMBERS. So the string I was looking for - in order to cancel the selection - was never found, it was always crashing. I will try Alfred's 'Result' thoug, I am still curious for this one...

As for the other two fellows who answered, you quick help was really appreciated and I hope to be able to help you back in the future! When I will no longer be a junior with DS...

Thank you again!

Nataly

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you so much Tanguy, Alfred and Gowtham for all your good answers!

Actually, in the script of my On Select, I was looking at the value of the member selected. In user connected in English, I was looking if my dimension was containing "Overall Result" and if connected in French, if the dimension value was "Résultat global". Indeed, the Overall result line is NOT a line of the member.

Thank you VERY much, this is wrorking fine for me in ALL my crosstab I need to show at top line the Overall resuts.

I would have flag ALL your answers are the correct one, but we can select only ONE. To me, you all have correct answers.

I hope I will be able to help you one day guys!

Again, many thanks!

Regards, Nataly

Former Member
0 Kudos

Hi Nathalie,

You can use getSelectedMember API for the Crosstab On Select event and write a if else condition with the logic below:

When you use Client.EXTERNALKEY :

if --> getSelectedMember of the Crosstab == "" ,

then do nothing.

When you use Client.INTERNALLKEY :

if --> getSelectedMember of the Crosstab == "(ALL_MEMBERS)" ,

then do nothing.


Note than getSelectedMember returns an empty string without any spaces when you use an External Key.


BR

Gowtham S

Former Member
0 Kudos

Thanks you very much Gowtham!

Very helpfull answer!