Page 1 of 1
Rules - Feed dimension attribute to a measure cell
Posted: Fri Jun 06, 2014 3:52 pm
by nayitian
Hi,
I am having a cube, one of the dimensions 'Sequence' is just purely numbers from 1 to 100, I want to feed these numbers to one of the measurement Seq_Code in the cube.
It works when I add such line in the rules,
['Seq_Code'] = N:attrn('Sequence', !Sequence, 'Sequence_Alias');
but when I add SKIPCHECK, and tried to add a Feeders statement, it went wrong. These are what I added in the rules,
Feeders;
['Sequence': 'Sequence_Alias'] => DB('CbueName', !Dim1, !Sequence, 'Seq_Code');
Could you please tell me what the correct statement should be? Thank you so very much.
Re: Rules - Feed dimension attribute to a measure cell
Posted: Fri Jun 06, 2014 4:10 pm
by lotsaram
Can you please provide actual code not pseudo code.
Re: Rules - Feed dimension attribute to a measure cell
Posted: Fri Jun 06, 2014 4:59 pm
by nayitian
lotsaram wrote:Can you please provide actual code not pseudo code.
Sure.
Cube Name: Courses
It has 3 dimensions, 1 Version (2010, 2011, ...)
2 Sequence ( 1, 2, ...100), it has an attribute 'Sequence_Alias' defined
3 Measurements (Seq_Code, Course_ID, Course_Name...)
The rules I wrote,
SkipCheck;
['Seq_Code'] = N:ATTRN('Sequence', !Sequence, 'Sequence_Alias');
Feeders;
['Sequence':'Sequence_Alias] => DB('Course', !Version, !Sequence, 'Seq_Code');
Re: Rules - Feed dimension attribute to a measure cell
Posted: Fri Jun 06, 2014 5:38 pm
by tomok
Why are you feeding the Seq_Code value? Is it because you don't want it to disappear on a zero suppress? If that is the case, do you just want it to not zero suppress when one or more of the other measures have a value? In that case you should feed from one of the other measures, not the Alias attribute (which, BTW, would not be recommended).
Re: Rules - Feed dimension attribute to a measure cell
Posted: Fri Jun 06, 2014 5:48 pm
by nayitian
tomok wrote:Why are you feeding the Seq_Code value? Is it because you don't want it to disappear on a zero suppress? If that is the case, do you just want it to not zero suppress when one or more of the other measures have a value? In that case you should feed from one of the other measures, not the Alias attribute (which, BTW, would not be recommended).
The column Seq_Code is assigned with numbers to identify each row as being a unique instance. It's going to be used as a lookup to retrive other measures.
Hope it makes sense.
Thank you.
Re: Rules - Feed dimension attribute to a measure cell
Posted: Fri Jun 06, 2014 6:16 pm
by tomok
nayitian wrote:The column Seq_Code is assigned with numbers to identify each row as being a unique instance. It's going to be used as a lookup to retrive other measures.
Hope it makes sense.
You didn't answer my question. Why are you feeding it?
Re: Rules - Feed dimension attribute to a measure cell
Posted: Fri Jun 06, 2014 7:44 pm
by Carl Lonsdale
If I gather what you are trying to do correctly:
You would like to automatically feed the Sequence # FROM an Number Type Attribute named: 'Sequence_Alias' on the Dimension:Sequence to the Cube Value:
'Seq_Code' in Measure.
In Terms feeding it
['Sequence':'Sequence_Alias] => DB('Course', !Version, !Sequence, 'Seq_Code');
Will Error because Sequence_Alias is an attribute not an element.
The classic style feeder wouldn't work here since you would be WAY over feeding.
To drive to Tomok's point: You need to feed it something else to denote a value flag:
Or alternatively, if you don't want a sequence code or another value to flag it you could not feed it.
On the other hand if you just want a feeder that works for feeders sake:
['Seq_Code'] => DB('Sequence', !Version, !Sequence, 'Seq_Code');
I think is what you are looking for.
Re: Rules - Feed dimension attribute to a measure cell
Posted: Fri Jun 06, 2014 7:56 pm
by tomok
The point I was trying to make is that feeding is not necessary for what he wants to do, use the value as a lookup into another calculation. A non-fed, rule-calculated cell will still have a value, regardless of its status of being fed. The only thing feeding will do for him is to stop the Seq_Code measure from being zero suppressed when it is being used as a column or row header in a view or active form.
Re: Rules - Feed dimension attribute to a measure cell
Posted: Wed Jun 11, 2014 2:32 pm
by nayitian
Carl Lonsdale wrote:If I gather what you are trying to do correctly:
You would like to automatically feed the Sequence # FROM an Number Type Attribute named: 'Sequence_Alias' on the Dimension:Sequence to the Cube Value:
'Seq_Code' in Measure.
In Terms feeding it
['Sequence':'Sequence_Alias] => DB('Course', !Version, !Sequence, 'Seq_Code');
Will Error because Sequence_Alias is an attribute not an element.
The classic style feeder wouldn't work here since you would be WAY over feeding.
To drive to Tomok's point: You need to feed it something else to denote a value flag:
Or alternatively, if you don't want a sequence code or another value to flag it you could not feed it.
On the other hand if you just want a feeder that works for feeders sake:
['Seq_Code'] => DB('Sequence', !Version, !Sequence, 'Seq_Code');
I think is what you are looking for.
Hi, thanks so very much. This helps a lot, and it's exactly what I want to learn and know.