cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAC - Fill Parameter Year in Data Action using Analytic App script

former_member40251
Participant
0 Kudos
1,611

Hello Experts,

I need to create a button in an Analytic App that will read Version and Year from Text fields that will be previously populated by dynamic filter. This values will be set as parameters for a Data Action execution.

In my data action I am able to set Year or Year+month in the parameter. In the Analytic App, if I set only Year (not YYYYMM), system returns an error that the paramater is not valid.

The script is like this:

var empregado = Txt_Nome_Empregado.getPlainText();

var mes = Txt_MesAno.getPlainText();

var versao = Txt_Versao.getPlainText();

DA_Elimina_Func.setParameterValue("Empregado","[RH_Empregado].[Empregados].&["+empregado+"]");

DA_Elimina_Func.setParameterValue("Mes_Ano","[Mes_Ano].[YM].&["+mes+"]");

DA_Elimina_Func.setParameterValue("TargetVersion",versao);

if variable "mes" have value 202201, it works. If it is 2022, an error is returned.

Need help to know how can I set the parameter in an Analytic App to accept Year, even if the field for date has "Year/Month" hierarchy.

kind regards

Mayumi

Accepted Solutions (1)

Accepted Solutions (1)

former_member40251
Participant
0 Kudos

Found out the solution.

Had to add [Mes_Ano.YEAR] on the setparameter script:

DA_Elimina_Func.setParameterValue("Mes_Ano","[Mes_Ano].[YM].[Mes_Ano.YEAR].&["+mes+"]");

kind regards,

Mayumi

Answers (1)

Answers (1)

former_member40251
Participant
0 Kudos

Hello Suzanne,

Unfortunately its not working in Analytic App "setparameter" script, even if the parameter has "any" on level.

Thanks

Mayumi