cancel
Showing results for 
Search instead for 
Did you mean: 

How to set Filter default display value as selected value

Former Member
0 Kudos

Hi All,

.

   I have three filters(Plant,material and year). i am getting the data on charts  based on filter default values

in plant filter on select i have given code bellow

DS_1.setFilter("Z_PPCD",PLANT.getSelectedValue());

MATERIAL.setItems(DS_1.getMemberList("Z_MATPCD", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 50));

in material filter,

DS_1.setFilter("Z_MATPCD",MATERIAL.getSelectedValue());

YEAR.setItems(DS_1.getMemberList("0CALYEAR", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 50));

in year filter,

DS_1.setFilter("0CALYEAR", YEAR.getSelectedValue());

when i run the report i am getting the all the data from data base

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To preselect a concrete known value in your dropdowns when your first open the report use the following dropdown's method to preselect an item from the list of dropdown's items:

setSelectedValue(value) -- Selects the item with the specified value.

after that apply the value preselected in the dropdown as a filter on the used datasource.

To apply default filters when you first open a report, make sure to place some scripting also into the:

Application > "On Startup" Event

and not only to the "On Select" events of your dropdowns.

General logic in a cascading filters scenario:

DROPDOWN_1.setItems(...);

DROPDOWN_1.setSelectedValue(...);

DATASOURCE_1.setFilter(...);

DROPDOWN_2.setItems(...);

DROPDOWN_2.setSelectedValue(...);

DATASOURCE_1.setFilter(...);

DROPDOWN_3.setItems(...);

DROPDOWN_3.setSelectedValue(...);

DATASOURCE_1.setFilter(...);

Example for your 3rd dropdown:

YEAR.setItems(DS_1.getMemberList("0CALYEAR", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 50));

YEAR.setSelectedValue("2011");

DS_1.setFilter("0CALYEAR", YEAR.getSelectedValue());

Regards

David

Former Member
0 Kudos

Hi David,

               Can you please explain me clearly regarding above code, i have small doubt. what code i need to write in Application > "On Start up" Event and what code for on select event of dropdown1.

Thanks,

Ramana

Former Member
0 Kudos

Hi Ramana,

Before I can answer you, I need to ask you something:

You have 3 dropdowns: 1. PLANT, 2. MATERIAL, 3. YEAR

From the code you have in your "on select" events it looks like that only MATERIAL and YEAR dropdowns are filled dynamically by scripting.

  1. How do you fill the values for the 1st dropdown PLANT? Do you insert the items manually? Do you want the items for PLANT to be inserted dynamically by scripting too?
  2. Which 3 values do you want to set as default values for the filters? Do you have the internal key for these 3 values (the internal key for year is probably just "2013")? If yes, I can include it in the code you need to include in the On Startup Event.

Regards

David

0 Kudos

Hello,

I have a dropdown and in the startup I have declared as:

DROPDOWN_1.setItems(DS_ALL_MAIN.getMemberList("0CALMONTH", MemberPresentation.TEXT,MemberDisplay.KEY, 13)); ----------------to set the items in dropbox

DROPDOWN_1.setSelectedValue(DS_ALL_MAIN.getVariableValueExt("ZE_CALMON"));----------------to set the default value = default value set in BeX (current month/current year)

Even then I am not able set the default value. It is still appearing as 09/2013 (lease value) instead of 09/2014 as default.

My On Select code for dropdown is:

APPLICATION.setVariableValue("ZE_CALMON", DROPDOWN_1.getSelectedValue()); ---------------to display rolling months

When I run the BeX query in rsrt, default value is currently set.

Please suggest

Thanks & Regards

Swasti

Former Member
0 Kudos

HI David,

I have worked similar way ( as per your previous post, setItems, setSelectedValue, then setFilter ), still my dropdown shows ALL values and doesn't take the selection I am passing.


The selection is reflected in data, in other affected charts.
But the dropdown holds "ALL"value in place of my default selected value
I have not specified "ALL" in the setItems.

Any thoughts on this?

Best Regards,

Rashmi

Answers (5)

Answers (5)

Former Member
0 Kudos

Hay,,

Can you please share source code of this DASHBOARD..????

Thanks in Advance,

Bharath

Former Member
0 Kudos

Hi,

As Nirupa suggests it is better to use a Dimension filter or FIlter panel(multiple cascading Filters),

Apart from being easy o configure, it also boosts your iniital load time, as retrieving and populating your Dropdown box tends to be slower.

Regards,

Fazith Ali Z

Former Member
0 Kudos

Hi Ramana,

Try to use 'Dimension Filter' component instead of combo box as shown in below image and write the script for start up filter values on the whole Application as in second image. By using this component you can pass either single or multiple or even certain range of values. Hope this might help you.

Former Member
0 Kudos

Hi RamanaReddy,

currently I had the same issue.

You have to define the initial selection criteria of your Data Sources (views) which you would like to use when starting the Design Studio application.

Please Select your "Analysis Application" -> Properties -> Events -> On Startup

The following example script statement should help:

[Name of your DataSource].setFilter("[Dimension]", "[specific filter value]");

DS_1.setFilter("0PLANT", "KEY_OF_PLANT1");

DS_2.setFilter("0MATERIAL", "KEY_OF_MATERIAL1");

DS_3.setFilter(0CALYEAR"; "2013");

This initial pre-selection guaranteed that not all the data (not all entries each dimension) from data base will be displayed.

Regards,

Michael

TammyPowlas
Active Contributor
0 Kudos

Nice dashboard

Did you try looking at setting up cascading filters as shown here: