Page 1 of 1
Missing Semi Colon in Rule ?
Posted: Mon Jun 27, 2011 8:43 am
by LeeTaylor1979
Hi all,
I am trying to write what i thought is a simply rule but keep getting the message missing semi Colon when I am clearly not.
My rule is:
IF(Mattype @= 'N');
'Quantity' = 'Occurrences';
Else;
'Quantity' = 'Number of Landings';
Endif;
Some added information, Mattype is a variable which holds either N or Y.
The quantity I am trying to change is the element in the measures dimension and not the actual quantity on the source file (Variable)
I then use the following:
CellPutN( Quantity + CellGetN( 'SalesHistory', Country, Aircraft, Customer, Material, Version, Currency, BusinessUnit, 'Quantity', Division,Period ),
'SalesHistory', Country, Aircraft, Customer, Material, Version, Currency, BusinessUnit, 'Quantity', Division, Period );
I have tried everything I can think of but still comes back with missing semi colon.
Can anyone see where I am going wrong.
Many thanks
Lee
Re: Missing Semi Colon in Rule ?
Posted: Mon Jun 27, 2011 8:48 am
by Michel Zijlema
What at least is wrong is that you have single quotes around quantity, making this a string literal instead of a variable - and you can't assign a value to a string literal.
Michel
Re: Missing Semi Colon in Rule ?
Posted: Mon Jun 27, 2011 8:50 am
by qml
In your code you're trying to assign a string value to another string value (NOT variable). How could that possibly work?
Try:
Code: Select all
IF(Mattype @= 'N');
Quantity = 'Occurrences';
Else;
Quantity = 'Number of Landings';
Endif;
and then
Code: Select all
CellPutN( Quantity + CellGetN( 'SalesHistory', Country, Aircraft, Customer, Material, Version, Currency, BusinessUnit, Quantity, Division,Period ),
'SalesHistory', Country, Aircraft, Customer, Material, Version, Currency, BusinessUnit, Quantity, Division, Period );
Edit: too late.
Re: Missing Semi Colon in Rule ?
Posted: Mon Jun 27, 2011 9:14 am
by LeeTaylor1979
Maybe I need to explain a little clearer what I am trying to achieve.
In my source file I have a column that is called mattype and also a column that is called Quantity.
Mattype hold either a N or a Y
In my cube I have a dimension called Measures which has Quantity, Occurrences and Number of landing as elements.
I am trying to do the following:
If Mattype is N then change the element Quantity in the cellput to be Occurrences or if Y then Number of Landings.
Can this be done ? If so how ?
Many thanks
Re: Missing Semi Colon in Rule ?
Posted: Mon Jun 27, 2011 9:37 am
by Alan Kirk
LeeTaylor1979 wrote:Maybe I need to explain a little clearer what I am trying to achieve.
Considering that the thread heading is "Missing semi colon in
Rule" and you're now describing a "source file" suggesting that it's actually a TI process... you could be right.
LeeTaylor1979 wrote:In my source file I have a column that is called mattype and also a column that is called Quantity.
Mattype hold either a N or a Y
In my cube I have a dimension called Measures which has Quantity, Occurrences and Number of landing as elements.
I am trying to do the following:
If Mattype is N then change the element Quantity in the cellput to be Occurrences or if Y then Number of Landings.
Can this be done ? If so how ?
What you really want is for the
element name to change based on what the MatType is. Quantity is, as I understand it, simply the value field in your data source, even though it may also be an element name in your measures dimension. (An element which, according to what you've written, you aren't using in at least this part of the upload.) Make what you're currently calling "quantity" a variable representing the element name like so:
Code: Select all
IF(Mattype @= 'N');
s_Quantity = 'Occurrences';
Else;
s_Quantity = 'Number of Landings';
Endif;
CellPutN( Quantity + CellGetN( 'SalesHistory', Country, Aircraft, Customer, Material, Version, Currency, BusinessUnit, s_Quantity, Division,Period ),
'SalesHistory', Country, Aircraft, Customer, Material, Version, Currency, BusinessUnit, s_Quantity, Division, Period );
Re: Missing Semi Colon in Rule ?
Posted: Mon Jun 27, 2011 10:09 am
by LeeTaylor1979
Alan, Thank you so much that has done the trick.
And you are quite right I have been talking about a TI process this whole time but failed to notice I used the word rule in my title
I blame the heat I am not used to it coming from the midlands.
thanks to all for your help.