Page 1 of 1
Dimix Syntax
Posted: Thu Jan 31, 2013 1:51 pm
by CelsoFerraz
Hi All,
I have a problem with the function Dimix. The syntax I need only work with a dimension Time :
for example : Dimix (Year , !Year ) or Dimix (Year, 'Jan') this owrk fine.
But when I try this with other dimension (not time dimension) , this not work.
for example : Dimix (business, !business ) not work , this only work with this syntax : Dimix (business , 'Director')
The message is syntax error, expression of sequence invalidates
anyone know why ?
Thanks
Re: Dimix Syntax
Posted: Thu Jan 31, 2013 2:06 pm
by tomok
Are you using it in a rule? If so, and you want to use the bang notation (!), the dimension has to exist in the cube you are writing the rule for.
Re: Dimix Syntax
Posted: Thu Jan 31, 2013 3:43 pm
by CelsoFerraz
Yes I´m using in rule and this dimension exists in two cubes but as picklist
This work :
['Classe' ] = S: if (DIMIX('Cargos','Diretoria' ) = DIMIX('Cargos',DB('Despesas Viagem1', !Cenarios, !Centro de Custo, !Meses, !Qtde Viagens, 'Posicao') ),
DB('Premissa Cargos', 'Diretoria', !Cenarios, 'Classe') ,continue);
this not work :
['Classe' ] = S: if (DIMIX('Cargos',!Cargos ) = DIMIX('Cargos',DB('Despesas Viagem1', !Cenarios, !Centro de Custo, !Meses, !Qtde Viagens, 'Posicao') ),
DB('Premissa Cargos', 'Diretoria', !Cenarios, 'Classe') ,continue);
The item Posicao is a Picklist (Cargos) in the cube Despesas Viagem1.
Re: Dimix Syntax
Posted: Thu Jan 31, 2013 6:46 pm
by tomok
At the risk of repeating myself, let me repeat. The dimension you are writing the DIMIX statement against HAS TO EXIST IN THE CUBE STRUCTURE. Using a picklist does not mean it is part of the cube structure. When you click on the plus sign next to the cube and expand the dimension list, is Cargos one of the dimensions listed????
Re: Dimix Syntax
Posted: Thu Jan 31, 2013 10:03 pm
by CelsoFerraz
Yes, cargos is a list in cube (picklist)
Re: Dimix Syntax
Posted: Thu Jan 31, 2013 10:12 pm
by declanr
tomok wrote:At the risk of repeating myself, let me repeat. The dimension you are writing the DIMIX statement against HAS TO EXIST IN THE CUBE STRUCTURE. Using a picklist does not mean it is part of the cube structure. When you click on the plus sign next to the cube and expand the dimension list, is Cargos one of the dimensions listed????
CelsoFerraz wrote:Yes, cargos is a list in cube (picklist)
On risk of Tomok having to choose between ripping out hair or finding a wall to bang one's head against...
It sounds like in your cube you have say:
CubeA : DimensionA, DimensionB, Measures
in one of those measures you have a picklist of the dimension type (picklist - dimension:gargos).
CelsoFerraz wrote:Yes I´m using in rule and this dimension exists in two cubes but as picklist
This work :
['Classe' ] = S: if (DIMIX('Cargos','Diretoria' ) = DIMIX('Cargos',DB('Despesas Viagem1', !Cenarios, !Centro de Custo, !Meses, !Qtde Viagens, 'Posicao') ),
DB('Premissa Cargos', 'Diretoria', !Cenarios, 'Classe') ,continue);
this not work :
['Classe' ] = S: if (DIMIX('Cargos',!Cargos ) = DIMIX('Cargos',DB('Despesas Viagem1', !Cenarios, !Centro de Custo, !Meses, !Qtde Viagens, 'Posicao') ),
DB('Premissa Cargos', 'Diretoria', !Cenarios, 'Classe') ,continue);
The item Posicao is a Picklist (Cargos) in the cube Despesas Viagem1.
You would need to change:
['Classe' ] = S: if (DIMIX('Cargos',!Cargos ) = DIMIX('Cargos',DB('Despesas Viagem1', !Cenarios, !Centro de Custo, !Meses, !Qtde Viagens, 'Posicao') ),
DB('Premissa Cargos', 'Diretoria', !Cenarios, 'Classe') ,continue);
to
['Classe' ] = S: if (DIMIX('Cargos',
DB ( CubeA, !DimensionA, !DimensionB, 'MeasureA') ) = DIMIX('Cargos',DB('Despesas Viagem1', !Cenarios, !Centro de Custo, !Meses, !Qtde Viagens, 'Posicao') ),
DB('Premissa Cargos', 'Diretoria', !Cenarios, 'Classe') ,continue);
Edit - Just to clarify CubeA is the cube in which this rule is attached...
Re: Dimix Syntax
Posted: Fri Feb 01, 2013 12:15 pm
by CelsoFerraz
I understand what you guys are saying, but what I'm trying to do I put in the attached file.
See if it is possible to do this via a rule or not.
Thanks again
Re: Dimix Syntax
Posted: Fri Feb 01, 2013 12:48 pm
by Duncan P
You need to use the text that is in the cell under the picklist. The only way to get at this is with a DB statement.
So something like this ...
Code: Select all
['Classe'] = S: DB( 'Premissa Cargos1', !Plan, DB( 'Despesas Viagem1', !Plan, !.... , 'Posicao' ), 'Classe' );
Re: Dimix Syntax
Posted: Fri Feb 01, 2013 3:33 pm
by CelsoFerraz
Duncan,
I did as you suggested and it worked
My rule now is :
['Classe' ] = S: DB('Premissa Cargos1',DB('Despesas Viagem1', !Cenarios, !Centro de Custo, !Meses, !Qtde Viagens, 'Posicao') , !Cenarios, 'Classe');
Thank Duncan, Declanr and Tomok for help