If statements and missing attributes
-
Can anyone help me out - I am trying to use an IF(,,) statement but sometimes it fails. This happens when the parent component does not contain the attribute the if statement is looking for, even when the attribute is not being executed on. For instance:
This works:
%(#0040BF)[Parent Component Attributes:
Left Length = 5
Corner Length = 10
Is Corner = "Yes"SubComponent Attributes:
Length = IF(Parent!Is Corner = "Yes",Corner Length,Left Length)]This doesn't work:
%(#0080FF)[Parent Component Attributes:
Left Length = 5
Is Corner = "No"SubComponent Attributes:
Length = IF(Parent!Is Corner = "Yes",Corner Length,Left Length)]I want to be able to insert the subcompnent into a variety of parent componets that all have the Is Corner attribute, but only a few have the Corner Length attribute.
An example of the if statement failing when referenced attribute does not exist.
-
Hi Pete,
There isn't a DC function that I know of to test if an attribute exists.
Maybe you could eliminate the IsCorner attribute, and use an "odd" value in CornerLength to indicate it is not a corner?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement