Subset having a cube of parameters
-
- Posts: 32
- Joined: Wed Nov 14, 2012 5:37 pm
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2007 STARDAND
Subset having a cube of parameters
Hello everyone,
I have a process that creates a subset in a dimension from some parameters defined in a source cube.
This is my code:
vANOINI=CellGetS('CMU.PARAMETROS_CARGA','Aplicar Filtros','Ano Inicial');
vANOFIN=CellGetS('CMU.PARAMETROS_CARGA','Aplicar Filtros','Ano Final');
SubsetDeleteAllElements('04.Ano', 'ANO_EM_PROCESSAMENTO');
vCONT=1;
vCONT=ATTRN('04.Ano',vANOINI,'ANO_NUMBER');
vIND=1;
vANO=vANOINI;
WHILE (vCONT <= ATTRN('04.Ano',vANOFIN,'ANO_NUMBER'));
IF(ATTRN('04.Ano',vANO,'ANO_NUMBER') > 0, SubsetElementInsert('04.Ano', 'ANO_EM_PROCESSAMENTO', vANO, vIND), 0);
vANO = DNEXT('04.Ano',vANO);
vCONT = vCONT + 1;
vIND = vIND + 1;
END;
CMU.PARAMETROS_CARGA is my cube where the parameters are informed.
I had to recreate this cube and add two new dimensions to it:
02.Canal_Expenses and 02.Companies_Group.
My code became this:
vANOINI = CellGetS ('CMU.PARAMETROS_CARGA', 'Apply Filters', vCANAL, vEMPRESASGRUPO, 'Starting Year');
vANOFIN = CellGetS ('CMU.PARAMETROS_CARGA', 'Apply Filters', vCANAL, vEMPRESASGRUPO, 'Final Year');
SubsetDeleteAllElements ('04 .Ano ',' ANO_EM_PROCESSAMENTO ');
vCONT = 1;
vCONT = ATTRN ('04 .Year ', vANOINI,' ANO_NUMBER ');
vIND = 1;
vANO = vANOINI;
WHILE (vCONT <= ATTRN ('04 .Year ', vANOFIN,' ANO_NUMBER '));
IF (ATTRN ('04 .Year ', vANO,' ANO_NUMBER ')> 0, SubsetElementInsert ('04 .Year', 'YEAR_EM_PROCESSING', vANO, vIND), 0);
vANO = DNEXT ('04 .Year ', vANO);
vCONT = vCONT + 1;
vIND = vIND + 1;
END;
But when running the process he informs me that he is not finding the dimensions of 02.Canal_Despens and 02.Empresas_Grupo.
In my data source I have the variables related to the dimensions mentioned.
I believe it is something very simple, but I ran the forum and did not find or could not read similar to this case.
I have a process that creates a subset in a dimension from some parameters defined in a source cube.
This is my code:
vANOINI=CellGetS('CMU.PARAMETROS_CARGA','Aplicar Filtros','Ano Inicial');
vANOFIN=CellGetS('CMU.PARAMETROS_CARGA','Aplicar Filtros','Ano Final');
SubsetDeleteAllElements('04.Ano', 'ANO_EM_PROCESSAMENTO');
vCONT=1;
vCONT=ATTRN('04.Ano',vANOINI,'ANO_NUMBER');
vIND=1;
vANO=vANOINI;
WHILE (vCONT <= ATTRN('04.Ano',vANOFIN,'ANO_NUMBER'));
IF(ATTRN('04.Ano',vANO,'ANO_NUMBER') > 0, SubsetElementInsert('04.Ano', 'ANO_EM_PROCESSAMENTO', vANO, vIND), 0);
vANO = DNEXT('04.Ano',vANO);
vCONT = vCONT + 1;
vIND = vIND + 1;
END;
CMU.PARAMETROS_CARGA is my cube where the parameters are informed.
I had to recreate this cube and add two new dimensions to it:
02.Canal_Expenses and 02.Companies_Group.
My code became this:
vANOINI = CellGetS ('CMU.PARAMETROS_CARGA', 'Apply Filters', vCANAL, vEMPRESASGRUPO, 'Starting Year');
vANOFIN = CellGetS ('CMU.PARAMETROS_CARGA', 'Apply Filters', vCANAL, vEMPRESASGRUPO, 'Final Year');
SubsetDeleteAllElements ('04 .Ano ',' ANO_EM_PROCESSAMENTO ');
vCONT = 1;
vCONT = ATTRN ('04 .Year ', vANOINI,' ANO_NUMBER ');
vIND = 1;
vANO = vANOINI;
WHILE (vCONT <= ATTRN ('04 .Year ', vANOFIN,' ANO_NUMBER '));
IF (ATTRN ('04 .Year ', vANO,' ANO_NUMBER ')> 0, SubsetElementInsert ('04 .Year', 'YEAR_EM_PROCESSING', vANO, vIND), 0);
vANO = DNEXT ('04 .Year ', vANO);
vCONT = vCONT + 1;
vIND = vIND + 1;
END;
But when running the process he informs me that he is not finding the dimensions of 02.Canal_Despens and 02.Empresas_Grupo.
In my data source I have the variables related to the dimensions mentioned.
I believe it is something very simple, but I ran the forum and did not find or could not read similar to this case.
- Steve Rowe
- Site Admin
- Posts: 2417
- Joined: Wed May 14, 2008 4:25 pm
- OLAP Product: TM1
- Version: TM1 v6,v7,v8,v9,v10,v11+PAW
- Excel Version: Nearly all of them
Re: Subset having a cube of parameters
Hi,
Suggest you post the whole TI and the whole error message.
The error message should have the line number and tab of the error in the log, which lines is this?
Cheers,
Suggest you post the whole TI and the whole error message.
The error message should have the line number and tab of the error in the log, which lines is this?
Cheers,
Technical Director
www.infocat.co.uk
www.infocat.co.uk
-
- Posts: 32
- Joined: Wed Nov 14, 2012 5:37 pm
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2007 STARDAND
Re: Subset having a cube of parameters
Hi Steve,Steve Rowe wrote: ↑Thu Jan 23, 2020 1:14 pm Hi,
Suggest you post the whole TI and the whole error message.
The error message should have the line number and tab of the error in the log, which lines is this?
Cheers,
Thank you for your help
Cod TI:
vANOINI=CellGetS('CMU.PARAMETROS_CARGA','Aplicar Filtros',vCANAL_DESPESAS,vGRUPO_ECONOMICO,'Ano Inicial');
vANOFIN=CellGetS('CMU.PARAMETROS_CARGA','Aplicar Filtros',vCANAL_DESPESAS,vGRUPO_ECONOMICO,'Ano Final');
SubsetDeleteAllElements('04.Ano', 'ANO_EM_PROCESSAMENTO');
vCONT=1;
vCONT=ATTRN('04.Ano',vANOINI,'ANO_NUMBER');
vIND=1;
vANO=vANOINI;
WHILE (vCONT <= ATTRN('04.Ano',vANOFIN,'ANO_NUMBER'));
IF(ATTRN('04.Ano',vANO,'ANO_NUMBER') > 0, SubsetElementInsert('04.Ano', 'ANO_EM_PROCESSAMENTO', vANO, vIND), 0);
vANO = DNEXT('04.Ano',vANO);
vCONT = vCONT + 1;
vIND = vIND + 1;
END;
Error Log: Error: Prolog procedure line (10): Invalid key: Dimension Name: "02.Canal_Despesas", Element Name (Key): ""
vANOINI is line 10 where it is giving the error in the process.
My source is another cube. In this process I need to create this subset based on the parameters informed. In the prolog tab I run this code so that it creates the subset only with the elements defined in the parameter and then in the data I apply the rules to load the data only in the elements defined in the parameter and created in the subset.
The variables vCANAL_DESPESAS and vGRUPO_ECONOMICO are variables in my source cube, I am convinced that with them it will not work, but I cannot make the process see these two dimensions (Channel of Expenses and Group Companies) within my CellGet.
-
- MVP
- Posts: 2832
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: Subset having a cube of parameters
So this is the offending line of code?:
I am assuming that the dimension 02.Canal_Despesas is the second dimension in the CMU.PARAMETROS_CARGA cube, correct? If so, the error message is telling you that the value in variable vCANAL_DESPESAS is an empty string which is why the CellGetS is erroring out.
Code: Select all
vANOINI=CellGetS('CMU.PARAMETROS_CARGA','Aplicar Filtros',vCANAL_DESPESAS,vGRUPO_ECONOMICO,'Ano Inicial');
-
- Posts: 32
- Joined: Wed Nov 14, 2012 5:37 pm
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2007 STARDAND
Re: Subset having a cube of parameters
tomok wrote: ↑Thu Jan 23, 2020 2:32 pm So this is the offending line of code?:
I am assuming that the dimension 02.Canal_Despesas is the second dimension in the CMU.PARAMETROS_CARGA cube, correct? If so, the error message is telling you that the value in variable vCANAL_DESPESAS is an empty string which is why the CellGetS is erroring out.Code: Select all
vANOINI=CellGetS('CMU.PARAMETROS_CARGA','Aplicar Filtros',vCANAL_DESPESAS,vGRUPO_ECONOMICO,'Ano Inicial');
Hello Tom,
Thank you for your help.
By the log, yes.
02.Canal_Expenses is the second dimension of the CMU.PARAMETROS_CARGA cube.
What I can't understand is that 02.Canal_Despens comes with an empty string message, however it is a dimension with elements contained in the cube CMU.PARAMETROS_CARGA
-
- Community Contributor
- Posts: 288
- Joined: Fri Feb 15, 2013 5:49 pm
- OLAP Product: TM1
- Version: PA 2.0.9.1
- Excel Version: 365
- Location: Minneapolis, USA
Re: Subset having a cube of parameters
As tomok said, your variable vCANAL_DESPESAS is blank. Where in the Prolog are you setting a value for that variable? I didn't see anything in the code you've posted, are they parameters?
-
- Posts: 32
- Joined: Wed Nov 14, 2012 5:37 pm
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2007 STARDAND
Re: Subset having a cube of parameters
Hello ascheevel,
Thank you for your help.
I am using the variables from my source cube.
- Attachments
-
- var.jpg (165.92 KiB) Viewed 3260 times
-
- MVP
- Posts: 2832
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: Subset having a cube of parameters
Showing us a picture of the Variables tab only proves that it is not blank for the first record in the dataset. Have you confirmed that ALL the records in the dataset have a value in vCANAL_DESPESAS? All it takes is one record to cause the error. While you're at it. Please show us the the entire line from the error log, not just a snippet. That line will tell you the record number where the blank occurs. Are you new to TM1?
-
- Community Contributor
- Posts: 288
- Joined: Fri Feb 15, 2013 5:49 pm
- OLAP Product: TM1
- Version: PA 2.0.9.1
- Excel Version: 365
- Location: Minneapolis, USA
Re: Subset having a cube of parameters
This is the error message you posted: Error Log: Error: Prolog procedure line (10): Invalid key: Dimension Name: "02.Canal_Despesas", Element Name (Key): ""
Prolog executes before the datasource is evaluated, so unless you're explicitly defining a value for vCANAL_DESPESAS in the Prolog tab, the variable will be blank until the first record of the datasource is read in the metadata/data tabs.