Page 1 of 1

Rule

Posted: Tue Sep 05, 2017 11:59 am
by st2000
Hope somebody could throw a light on my misunderstanding:

I try to implement a spreading procedure and first of all I want to have an indicator for changes at all (by rule).
I attached a picture showing the cube, the attributes cube assigned to the main cube and the rule:

Code: Select all

['Changed',{'A','B'},'Expenses'] = IF (DB('Value',ATTRS('Status', !Status, 'Deltaelement'),'Expenses') = 0 , 1, 2);
The attribute is correctly resolved as 'A_Delta' resp. 'B_Delta', and I can save the rule and refresh the cube viewer without errors.
But the cell Valuetype=Value,Status=A_Delta,acc2=Expenses contains '200', which is != 0, so I'd expect the rule to get a result of '2' here, where ValueType=Changed, which should be the indicator to process the A_Delta afterwards.
DB_ATTRS_RULE.png
DB_ATTRS_RULE.png (59.91 KiB) Viewed 3390 times
I fear it is a very 'dummy' question, but I didn't find something similar in the historic posts...
(The xy_Delta-cells are intended to take input in a websheet, later these inputs should be spreaded via TI instead of immediately via contextmenu spreading methods.)
DB_ATTRS_RULE_Cubemodel.png
DB_ATTRS_RULE_Cubemodel.png (10.23 KiB) Viewed 3390 times

Misunderstanding of the correct FEEDER, maybe?

Re: Rule

Posted: Tue Sep 05, 2017 12:23 pm
by tomok
st2000 wrote: Tue Sep 05, 2017 11:59 am

Code: Select all

['Changed',{'A','B'},'Expenses'] = IF (DB('Value',ATTRS('Status', !Status, 'Deltaelement'),'Expenses') = 0 , 1, 2);
Check your syntax on this rule. The proper syntax when using DB to reference a cube is:

DB('Name of Cube', Dim1, Dim2, Dim3....Dimx)

Re: Rule

Posted: Wed Sep 06, 2017 8:00 am
by st2000
Aaarghh, indeed it WAS a dummy question, just oversaw the missing cubename in DB-formula while thinking around potential errors in ATTRS.
Sorry for polluting the forum and thanks for the hint... :oops:

Re: Rule

Posted: Wed Sep 06, 2017 9:38 am
by lotsaram
tomok wrote: Check your syntax on this rule. The proper syntax when using DB to reference a cube is:

DB('Name of Cube', Dim1, Dim2, Dim3....Dimx)
Yes. Although it would be a pretty decent enhancement if you could use a blank string as the first argument in a DB() to mean "Me. The cube that I'm in" the same way that it works for the ConsolidatedAvg/Min/Max/Count functions.
It would make generic rules that much more portable.

I'm not holding my breath.