cancel
Showing results for 
Search instead for 
Did you mean: 

Crosstab - Deselection of Selected row displaying the value in text box

0 Kudos

Hi All,

I am having a Crosstab, 1Text box and 1Chart as Components with Bex Query as datasource in DS 1.4 SP2

When I click on the rows in crosstab  the chart and the text box changes dynamically with the values based on the selection as expected and works fine.

The issue is when I again select the same row it deselects the values applied and gives the overall values in chart which is perfectly fine but the

text box does not changes. It should show something like Overall fina Adj amt(screenshot 1).

Instead of that it is showing ALL_members(screenshot2). I cannot find any deselect option in the code for onselect in the crosstab so that I can bring back that text value.

can you please help me if there is any other option to achieve this.

Thanks for your help!

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Arunnesh,

I encountered exactly the same issue when implementing a hierarchical filter example where a crosstab selection drives a chart as well as updating a text field with the selected value.  So, as I understand it, as was the case in my scenario, your problem relates to the description returned when a row is DESELECTED, rather than the description returned when a results row ("Overall Result") is selected.

When a crosstab row is deselected, the standard behaviour is that the getSelectedMember() method returns "(ALL_MEMBERS)" for the internalKey and null for the text.  I can confirm this behaviour is the same in DS 1.5.  So all you need to do in your script is test for "(ALL_MEMBERS)" and then substitute your own more user-friendly text.

I have demonstrated this in the example below.

Since you have indicated your scenario includes two dimensions, I have replicated this for completeness, showing both key and text values, in one case without substitution and the other with substitution so the difference is clear.

The "On Select" event script of the crosstab is coded as follows:

var selectedDimension1 = me.getSelectedMember("ZAIRLINID__ZAIREGN");

var selectedDimension1_Key = selectedDimension1.internalKey;

var selectedDimension1_Text = selectedDimension1.text;

var selectedDimension2 = me.getSelectedMember("ZAIRLINID");

var selectedDimension2_Key = selectedDimension2.internalKey;

var selectedDimension2_Text = selectedDimension2.text;

var textWithoutSubstitution = ": " + selectedDimension1_Key + " " + selectedDimension1_Text + " - " + selectedDimension2_Key + " " + selectedDimension2_Text;

TEXT_3.setText(textWithoutSubstitution);

// Substitute alternative text if selected key is "(ALL_MEMBERS)"

if (selectedDimension1_Key == "(ALL_MEMBERS)"){

  selectedDimension1_Key  = "Overall Dim 1 (Key)";

  selectedDimension1_Text = "Overall Dim 1 (Text)";

  selectedDimension2_Key  = "Overall Dim 2 (Key)";

  selectedDimension2_Text = "Overall Dim 2 (Text)";

}

var textWithSubstitution = ": " + selectedDimension1_Key + " " + selectedDimension1_Text + " - " + selectedDimension2_Key + " " + selectedDimension2_Text;

TEXT_4.setText(textWithSubstitution);

On startup, the text defaults to "ALL" as shown below:

When a single row is selected the output is as shown below.  Both texts are the same since no substitution occurs.

When the row is deselected the output is as shown below.  This time you can see the result of the substitution logic in the second text line.


If your crosstab includes result rows then you will also need to include substitution logic for those as well, otherwise you will get the default values as shown below:


I think the above solution via scripting would be the quickest and easiest.  If you want to change the result descriptions permanently for all BEx queries you could consider implementing the modification described in SAP Note 527707.  However, I'm not sure if Design Studio would automatically pick up the modified texts in this case.

EDIT:  On further review, I've realised the SAP note will not impact the non-result rows which is the main issue here, so I think that leaves the scripting solution above as the only option.

Regards,

Mustafa.


Message was edited by: Mustafa Bensan - added comment about SAP Note.

0 Kudos

Hi Mustafa,

That's great!!! It perfectly worked!!!!Thank you so much and truly appreciate all your help on this in giving such a clear and detailed solution.

I had some modifications to do to fit in my requirement where a static text needs to be there in the text box so i added after the variable.When I did the selection of rows and deselection of rows it works perfectly without  ALL_MEMBERS being displayed.

I have attached screenshot for reference and again Thank You for all your help!!!

Thanks,

Arunnesh

MustafaBensan
Active Contributor
0 Kudos

Hi Arunnesh,

It's good to hear that the approach worked.  Thanks for sharing your variation on it.

Regards,

Mustafa.

Former Member
0 Kudos

Hello Mustafa,

Could you please help me in selection of Cross tab.

We are using Design Studio 1.5 and when we are trying to select a line in Cross tab, it always retrun 'ALL_MEMBER' as internal key.

Could you please suggest the workaround solution for this issue?

Regards,

Nikunj

Answers (1)

Answers (1)

TammyPowlas
Active Contributor
0 Kudos

Can you share a screen shot of how you are displaying the values in the text box?  The script too?

Use the camera icon to upload a screen shot.  Thank you

0 Kudos

Thanks Tammy for the response. I have attached the screenshot for the Onselect of Crosstab.

Initially when I run the application first time it gives me a Overall view with the Text being displayed as Overall (since I hard coded this value on Startup)as in the previous screenshot. Then when I do drill down across various rows in the crosstab the chart and the textbox gets changed perfectly.


I have two dimensions which gets combined and displays in the Text box and works fine when I select a row of crosstab(screenshot below) The issue starts When I click again on the same row it shows ALL_MEMBERS in the textbox as in my previous screenshot.


I tried with another text box just to implcitly have the Overall Amt being displayed but still the ALL_MEMBERS keeps appearing in the textbox.

TammyPowlas
Active Contributor
0 Kudos

Hi Arunnesh - I am on 1.5 Design Studio and using your script it appears to work fine (although the cross tab properties are different); if your requirement is critical, is there a chance you could try this with Design Studio 1.5?

0 Kudos

We are in a  critical road block where (ALL_MEMBERS) as it looks more of Technical back end display as this is more of executive dashboard to senior mgmt which they would never want to see in this format.

I can surely recommend to move in 1.5 at the earliest if you could please let me know that the functionality of deselecting a row in crosstab does not give the ALL_MEMBERS and Can you please let me know what is being displayed in the textbox ?

Thanks a lot for all your help!!!

TammyPowlas
Active Contributor
0 Kudos

Hi - I am not going to guarantee anything, as our application settings could be different.  That said, when I try to do what you are describing, I don't see "all members".  Please keep in mind the crosstab properties are different in 1.5 than 1.4

See selection of 1 member (I didn't concatenate like you) (text box is in upper left):

See selection of overall results:

A low time-consuming suggestion is to try this on a machine that has Design Studio 1.5 client and see if it meets your requirements.

0 Kudos

Thanks Tammy for all your help!!


I will try implementing on the 1.5 Client system.