cancel
Showing results for 
Search instead for 
Did you mean: 

Showcase filtered data in text box (Release 1.5)

Former Member
0 Kudos

Hi,

Back end being used is HANA and Release is 1.5

I take "REQUEST_ID" as input from the user, and then filter the data based on this request id.

Their are 10 dimensions which change their value based on this request id. I want to showcase values of these dimensions in text box. Also, in case I change the request id, corresponding change should be reflected in dimension values as well in text box.

1.  var input_data=INPUTFIELD_1.getValue();

     DS_1.setFilter("REQUEST_ID", input_data);

     This script filters and showcase correct data in crosstab. I went through other threads which said we can display data in text box by selecting it             from this crosstab. I don`t want this, infact I don`t intend to use crosstab. I want data directly in text box.

2.  One of the dimension is "APPROVAL_1". I tried to fetch its value in text box "TEXT_2" with the following script.(This was done after filtering the            values based on request id)

      TEXT_2.setText(DS_1.getMemberDisplay("APPROVAL_1"));

      This gave me an output result as "key".

3.   I cannot populate all the request id in dropdown and later select one among them, as number of request id runs in millions.

What I understand is filtering works for crosstab, but as soon as I try to fetch data corresponding to a particular dimension, it doesn`t.

I want to filter the data based on input from user, once I execute the application and then display values of dimension in textbox.

How can this be done?

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

HI Prakhar,

The reason why your output is "key" instead of the member value is because you are using getMemberDisplay() instead of getMembers().  The getMemberDisplay() method does not return the value of the dimension member but just how it is displayed (eg. "key", "text" etc).

Assuming that the "REQUEST_ID" is unique in your data set and returns only one row after filtering, you can try the following script code:


var input_data=INPUTFIELD_1.getValue();

DS_1.setFilter("REQUEST_ID", input_data);


var myApproval = DS_1.getMembers("APPROVAL_1", 100);

myApproval.forEach(function(approval, index) {

 

  TEXT_2.setText(approval.text);

});

The above approach worked for me with a BW BEx data source.  Make sure in the Initial View of the data source you set the APPROVAL_1 dimension Members for Filtering option to "Only values with posted data".

You cannot use the option of a hidden Crosstab because a row must be physically selected with a mouse click in order for the getSelectedMember() method to return a value.  By default, a Crosstab is displayed with no row selection and it is not possible to set the default via scripting.

Let me know how you go.

Regards,

Mustafa.

Former Member
0 Kudos

Hi Mustafa,

That`s perfect and is working exactly as I wanted. Thank you so much.

Answers (1)

Answers (1)

TammyPowlas
Active Contributor
0 Kudos

The methods you are using above would work with a crosstab; is there a reason you don't want the crosstab?

Otherwise, you will need to look at other methods

Former Member
0 Kudos

Hi Tammy,

I`m creating a dashboard with some charts included in the remaining portion of the screen. Also, as per requirement ,table(crosstab) shouldn't be included.

I tried to put a crosstab and hide it while execution and run script mentioned in point no. 2, but even that displayed "key" as output.

So, if values can be retrieved after filtering directly into textbox, it would be the best solution for me. If not this, then I`m open to loading data in crosstab and then fetching values from there into text box, but crosstab shall remain invisible in this case too.

Please suggest me which one is a better approach and how can it be achieved.

Prakhar

TammyPowlas
Active Contributor
0 Kudos

Assuming you go the crosstab route, you could use TEXT_1.setText(CROSSTAB_1.getSelectedMember("APPROVAL_1").text); to bring back text instead of key

Former Member
0 Kudos

Hi Tammy,

Tried this also .Thank you so much.