The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Generating an attribute if it does not already exist
Either my searching skills are deficient or there isn't an obvious way of doing this...
I am pivoting data which may not or may not generate the attributes I need depending on each example's actual data. This means that I get varying sets of attributes from the operator which is causing havoc later on in the process. I want to generate any missing attributes but I can't find an easy way to do this.
In theory I was just going to add a Generate Attributes operator and create each one conditionally on whether it already exists. But how do I test for the existence of an attribute?
Many thanks!
I am pivoting data which may not or may not generate the attributes I need depending on each example's actual data. This means that I get varying sets of attributes from the operator which is causing havoc later on in the process. I want to generate any missing attributes but I can't find an easy way to do this.
In theory I was just going to add a Generate Attributes operator and create each one conditionally on whether it already exists. But how do I test for the existence of an attribute?
Many thanks!
0
Best Answer
-
kayman Member Posts: 662 UnicornThe branch operator allows you to check if an attribute exists or not, but if you have like a lot of them this can become pretty annoying. So in practice we also have a collection of dummy sets (but without actual records) and use the Append Superset operator.5
Answers
Dortmund, Germany
Yes I do. I just came up with what felt like a very hacky way of doing this by creating an exampleset with a single example including all the attributes defaulted to zero plus a static id which I then do a join on to the master example such that any attributes in the master example are retained.
Feels hacky but does seem to work If there's a neater solution would love to hear it!
Thanks,
Paul
Dortmund, Germany