cancel
Showing results for 
Search instead for 
Did you mean: 

How to select dynamic crosstab using Radio button selection?

chandrasekhar6
Participant
0 Kudos
503

Hi

Currently using version Lumira Designer 2.1 SP01

I have a scenario as like below,

we are using 2 Radio buttons:

Radio button1: State and City items related data.

Radio button2: Year and Month items data.

and 4 crosstabs with different data sources like DS1, DS2, DS3, and DS4

Suppose I have select in Radion button1: State and Radio button2: Year then how to show below crosstab,

Radion button1: State and Radio button2: Month then how to show below crosstab,

Radion button1: City and Radio button2: Year then how to show below crosstab,

Radion button1: City and Radio button2: Month then how to show below crosstab,

how to change dynamic cross using radio button selections.

Please help on the above scenario.

Thanks,

Chandrasekhar .K

Accepted Solutions (0)

Answers (1)

Answers (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Chandra,

It seems you have already asked a very similar question: https://answers.sap.com/questions/503887/how-to-select-set-of-dimension-using-radio-button.html

You can apply the same solution to this scenario.

Regards,

Mustafa.

chandrasekhar6
Participant
0 Kudos

Hi Mustafa,

Thanks, for your response.

Using : https://answers.sap.com/questions/503887/how-to-select-set-of-dimension-using-radio-button.html this link

I have written below script in Radio button,

if(RADIOBUTTONGROUP_2.getSelectedValue() =='Value1')
{
DS_2.removeDimension("STATE");
DS_2.removeDimension("CITY");
DS_2.removeDimension("Store_name");
DS_2.moveDimensionToRows("YEAR");
DS_2.moveDimensionToRows("QUARTER");
DS_2.moveDimensionToRows("MONTH");
DS_2.moveDimensionToRows(RADIOBUTTONGROUP_2.getSelectedValue());   
}
else
{
DS_2.removeDimension("YEAR");
DS_2.removeDimension("QUARTER");
DS_2.removeDimension("MONTH");
DS_2.moveDimensionToRows("STATE");
DS_2.moveDimensionToRows("CITY");
DS_2.moveDimensionToRows("Store_name");
DS_2.moveDimensionToRows(RADIOBUTTONGROUP_2.getSelectedValue());
}
<br>

Above script working perfectly for single Data Source and single crosstab.

Current Scenario Details:

Note:

  • Here I am using 4 crosstabs map 4 different sources.

I have tried below process,

Radio button1:

if(RADIOBUTTONGROUP_1.getSelectedValue() =='CITY')
{
RADIOBUTTONGROUP_2.setSelectedValue("YEAR");
}
else
if(RADIOBUTTONGROUP_1.getSelectedValue() =='STATE')
{
RADIOBUTTONGROUP_2.setSelectedValue("YEAR");
}<br>

Radio Button2:

if((RADIOBUTTONGROUP_1.getSelectedValue() =='CITY') ||(RADIOBUTTONGROUP_2.getSelectedValue() =='YEAR'))
{


CROSSTAB_1.setVisible(false);
CROSSTAB_3.setVisible(true);
CROSSTAB_2.setVisible(false);
CROSSTAB_4.setVisible(false);


}


if((RADIOBUTTONGROUP_1.getSelectedValue() =='CITY') ||(RADIOBUTTONGROUP_2.getSelectedValue() =='MONTH'))
{
CROSSTAB_3.setVisible(false);
CROSSTAB_4.setVisible(true);
CROSSTAB_1.setVisible(false);
CROSSTAB_2.setVisible(false);


}


if((RADIOBUTTONGROUP_1.getSelectedValue() =='STATE') ||(RADIOBUTTONGROUP_2.getSelectedValue() =='YEAR'))
{


CROSSTAB_1.setVisible(true);
CROSSTAB_3.setVisible(false);
CROSSTAB_2.setVisible(false);
CROSSTAB_4.setVisible(false);


}

//if((RADIOBUTTONGROUP_1.getSelectedValue() =='STATE') ||(RADIOBUTTONGROUP_2.getSelectedValue() =='MONTH'))
else
{
	CROSSTAB_3.setVisible(false);
CROSSTAB_4.setVisible(false);
CROSSTAB_1.setVisible(false);
CROSSTAB_2.setVisible(true);
}<br>

I am getting the output as like,

Suppose I have selected City and Year, I am getting State & Year related data,

Select City and Month I am getting State & Month related data.

Select State and Year & State and Month, I am not getting any data.

Thanks,

Chandrasekhar.K

MustafaBensan
Active Contributor
0 Kudos

Chandra,

It seems to me that all four data sources are assigned to the same query and you only want to display one of the Crosstabs at any given time. If that is the case, there is no need for multiple data sources and Crosstabs. You can simply include only one data source and one Crosstab, then use the Radio Button selections to trigger swapping in and out of the corresponding dimensions.

Regards,

Mustafa.