Question Struggling with Syntax

Joined
Nov 8, 2020
Messages
9
Likes
4
Points
3
#1
I have the following Rule restricted on a single N level element in the Projects Dimension. All other dimensions are restricted to all N level elements
Code:
IF(CHILD("Projects","Default" ,"Projects Total",3) = 
    Link("Budget and Forecast" ,[ "Periods:Total","Project" ])
          , 300  ,  CHILD("Projects","Default" ,"Projects Total", 3))
+  IF(CHILD("Projects","Default" ,"Projects Total",4) = 
    Link("Budget and Forecast" ,[ "Periods:Total","Project" ])
          , 400  ,  CHILD("Projects","Default" ,"Projects Total", 4))
Where the IF statement was false it did not return the value of the Element but appears to have only returned the element name which looks correct and thus no value so I tried this

Code:
IF(CHILD("Projects","Default","Projects Total",3) = 
    Link("Budget and Forecast" ,[ "Periods:Total","Project" ])
          , 300  ,   '["'& CHILD("Projects","Default","Projects Total" ,3) &'"]')
+ IF(CHILD("Projects","Default","Projects Total",4) = 
    Link("Budget and Forecast" ,[ "Periods:Total","Project" ])
          , 400  ,   '["'& CHILD("Projects","Default","Projects Total" ,4) &'"]')
This did not work either.
So my question is what syntax do I have to use to put a calculated Element into the [ ] brackets so I get the value of the field. I also tried ELEMENTBYPOSITION using a flat hierarchy instead of CHILD

Do I have to use a LINK statement and will that take a calculated element.
 
Joined
Feb 27, 2020
Messages
43
Likes
23
Points
8
#2
SEQUENCE(Dimension, Hierarchy, SequenceShift, RelativeLocation) will bring back sequence - but usually only applied to period dim

LINKBY(CubeName, RelativeLocation, ValueLocation) might work?
you need a mapping created for the combinations and the LINKBY("SourceCubeName", ["Element 1", "Element N"], MAPPING("Mapping Name", "LR"))