cancel
Showing results for 
Search instead for 
Did you mean: 

how to show / hide keyfigures

dieterzenger
Participant
0 Kudos
436

Hi,

i need to show/ hide different key figures (measures) in my data source based on the selection in a list box. i checked the ipad example (template3) which contains an example on restriction on measures. in my case it does not work. How do i know the name of my key figures dimension .

in the Example its stated like this:

DS_1.setFilterExt("Keyfigures", LST_MEASURES.getSelectedValue());

--> the syntax checker is complaining about "Keyfigures" ? how do i find the name in the Query / DS i embedded.

Tahnk you

dieter

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dieter,

I've created an example with a radio button to select the display

"Previous year versus Current Year" or "Budget versus Current Year"

Here is the corresponding coding

if ( FILTER_KYF.getSelectedValue() == 'BUD' )

{ DS_ANALYSIS.setFilterExt("00O2TMB1V91PPLDL99A8E33VD","00O2TMB1V91PPLDLKBZGDK21L; 00O2TMB1V91PPLDLKBZGDK8D5; 00O2TMB1V91PPLDLKBZGDKL09"); 

}

else

{ DS_ANALYSIS.setFilterExt(

"00O2TMB1V91PPLDL99A8E33VD","00O2TMB1V91PPLDL99A8E3GIH; 00O2TMB1V91PPLDLKBZGDK21L; 00O2TMB1V91PPLDLKBZGDKEOP"); 

}

The technical names of the key figures are coming from the query designer (cfr tab page Extended on key figure level).

- 00O2TMB1V91PPLDL99A8E33VD         Key figures (Structure)

- 00O2TMB1V91PPLDL99A8E3GIH          Revenue previous year

- 00O2TMB1V91PPLDLKBZGDK21L        Revenue current year

- 00O2TMB1V91PPLDLKBZGDK8D5       Budget current year

- 00O2TMB1V91PPLDLKBZGDKL09        Variance current year / budget

- 00O2TMB1V91PPLDLKBZGDKEOP      Variance previous year / current year

Regards,

  Ann

dieterzenger
Participant
0 Kudos

Thank you Ann

Answers (1)

Answers (1)

henrique_pinto
Active Contributor
0 Kudos

What has worked for me (working with a HANA Calc View as Data Source) was the following:

  • First, in the application's .onStartup() event (or in some other initializing event), you need to read the possible Measure names (in my case, to a dropdown box):

DROPDOWN_1.setItems(DS_1.getMemberList("[Measures]", "KEY", "TEXT", 5, "All"));

     (in this case, 5 is the total number of Measures I have in my Calc View).

  • Then, in the Dropdown's .onSelect() event, I set the filter's execution itself:

DS_1.setFilterExt("[Measures]", DROPDOWN_1.getSelectedValue());

It works like a charm.

I suppose working with a BW Data Source, you have a different keyfigure dimension name, but just use ctrl+space and it'll prompt with the proper value for you. Also, if you want to allow multiple Measures other than the "All" case, I suppose you need to change the logic to something more custom specific, on the likes of what Ann did.

Best regards,

Henrique.