Is there a way to use fields from a parent section in a data model to calculate a field.
For example,
ParentSection
ParentField
ChildSection
ChildField
Could I somehow use IIF(ParentField="string", 1, 0) as a calculation for ChildField, because right now I can't reference parent fields in the calculation? I can only reference other ChildSection fields.
ParentSection
ParentField
ChildSection
ChildField
Could I somehow use IIF(ParentField="string", 1, 0) as a calculation for ChildField, because right now I can't reference parent fields in the calculation? I can only reference other ChildSection fields.
Tagged:
0
Best Answer
-
jclark Posts: 60 ✭✭✭
@Aston
Setting your calculate expression to: ParentInstance.ParentSection.Fields("IN Product Code").Value
should correct your issue. As we are referencing the field name directly we should be using the exact spelling of the name and should not need to use underscores instead of spaces, also the "N" should be capitalized in the field name as well.
As you can see in the updated screenshots below the Child Section with the underscores does not work but the Child Section 2 without underscores does.
5
Answers
However, I see a note that the article is still in progress and traversing the data model's hierarchy is one of the things needed. @Brian is this something you could help with in the mean time?
Director of Strategy
[email protected]
@Aston
Does this Calculate Expression help with your issue of not being able to reference Parent Fields?
Below is the output showing that the value from the ParentField from the Parent Section can be referenced to populate the ChildField in the Child Section.