cancel
Showing results for 
Search instead for 
Did you mean: 

If Then Else for Crosstab & Dropdown in Design Studio

former_member261309
Participant
0 Kudos

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";

}

Accepted Solutions (0)

Answers (7)

Answers (7)

former_member261309
Participant
0 Kudos

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).

MustafaBensan
Active Contributor
0 Kudos

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.

IvervandeZand
Product and Topic Expert
Product and Topic Expert

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

former_member261309
Participant
0 Kudos

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

I ran the command but not able to locate the characterstic 😞

TammyPowlas
Active Contributor
0 Kudos

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

former_member261309
Participant
0 Kudos

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


former_member261309
Participant
0 Kudos

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.

TammyPowlas
Active Contributor
0 Kudos

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

TammyPowlas
Active Contributor
0 Kudos

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.