Skip to Content
0

If Then Else for Crosstab & Dropdown in Design Studio

Nov 28, 2016 at 11:39 AM

994

avatar image
Former Member

Hello

We have a Bex dimension CITY which is stored in a numerical way for e.g For New York its 101 and for London its 201, 401, 601, & 801, I am trying to combine them in Design Studio with if else statement and tried writing a code so that accordingly it should reflect in cross tab like by the selection of drop down, but on the selection nothing is working, I am new to Design Studio wizard, please advise if I am using wrong function

if(DROPDOWN_1.setSelectedValue("New York")){

CROSSTAB_1.getSelectedMembers("Z_CITY") == "101";

}

else

CROSSTAB_1.getSelectedMembers("Z_CITY") == "201,401,601, 801";

}

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

7 Answers

Tammy Powlas
Nov 28, 2016 at 12:33 PM
0

I don't think you want to go the if-then-else route

You can simply show the text of your member, and it will select it accordingly:

DS_1.setFilter("Z_CITY", DROPDOWN_1.getSelectedValue());

DROPDOWN_1.setItems(DS_1.getMemberList("Z_CITY", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 5, "ALL"));

I am selecting the MemberDisplay.TEXT - I recommend you try it as well.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 28, 2016 at 01:32 PM
0

Thank you Tammy , now atleast with your response my crosstab is changing :) . However with MemberDisplay I am not able to satisfy the condition for the city , when I select New York in drop down its showing all the values with All whereas I was expecting it to display only 101 as in the drop down I have selected New York. We don't have the dimension set with names , it has codes only 101, 201 , 301, 501 where the users know that 101 is for New York and rest is for London. So I am trying to group them.

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

Can you share more details on how your Z_CITY info object is set up? 101 doesn't have a description?

0
avatar image
Former Member Nov 28, 2016 at 05:03 PM
0

Thank you Tammy. I have access to bex query designer and when I open the query I just see description as City for this infoobject


Share
10 |10000 characters needed characters left characters exceeded
Tammy Powlas
Nov 28, 2016 at 05:05 PM
0

In your BW system, can you go to transaction RSD1 for Z_CITY, Business Explorer tab, what does that show?

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 28, 2016 at 05:47 PM
0

I see it as an free characterstic and is being displayed as text.

I ran the command but not able to locate the characterstic :(

Share
10 |10000 characters needed characters left characters exceeded
Mustafa Bensan Nov 29, 2016 at 04:23 AM
0

Hi Piyush,

As Tammy has pointed out, this is not something that should be done on the front-end with Design Studio. It is more of a BW modelling issue. It sounds like your city dimension is defined as a code only, without any texts. I would suggest the following:

1) Change the Z_CITY dimension so that texts are activated and then upload the corresponding city texts;

2) Based on your example for London, it seems like the codes are not unique city codes because you have several codes for London. If that's the case, you should use a more appropriate City dimension from your BW system which actually represents a city. Alternatively you could create a BW hierarchy for to group the Z_CITY codes into the corresponding cities. However, in this latter case you will not be able to use a Dropdown to select cities because the Dropdown component doesn't support hierarchies, so as an alternative you can use a Crosstab with just one column as a selector.

Regards,

Mustafa.

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

appreciate this feedback Mustafa. This is definately an issue that needs to be solved in BW rather than trying to lon,g statements in Design Studio

1
avatar image
Former Member Nov 29, 2016 at 09:22 AM
0

I agree Mustafa will surely check on what you have suggested, though the same works like a charm in Webi using input control on the same BEx query. I understand that it would not work the same way in Design Studio, though I am wondering at least I should be able to use IF ELSE to make this selection in cross tab, its just like I am trying to group them using two keywords (which usually should work for any tool who understand if else statements, as webi understands).

Share
10 |10000 characters needed characters left characters exceeded