Skip to Content
avatar image
Former Member

If Then Else for Crosstab & Dropdown in Design Studio

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

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Nov 28, 2016 at 12:33 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 28, 2016 at 01:32 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

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

    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


    Add comment
    10|10000 characters needed characters exceeded

  • Nov 28, 2016 at 05:05 PM

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 28, 2016 at 05:47 PM

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

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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 29, 2016 at 04:23 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

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

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

    Add comment
    10|10000 characters needed characters exceeded