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
How to automatically select a subset of attributes which names have been varied
Dear all,
I am about to reduce manual steps in my current process. But now I came to a point where I got stuck.
The original example set looks like this:
att1 att2 att3
1 3 6
2 4 7
3 5 8
4 6 9
After the first steps of processing (I do windowing) I receive a new set with more attributes:
label att1-0 att1-1 att2-0 att2-1 att3-0 att3-1
Then I want to split into "subsets" and this is where I struggle. Each subset shall include the label and all variations of each original attribute:
First iteration label, att1-0 and att1-1
Second iteration label, att2-0 and att2-1
Third iteration label, att3-0 and att3-1
My intention is to run a selection algorithm with each subset next and finally merge the remaining attributes in a single set again:
e.g. label, att1-0, att2-1, att3-0 (attributes according selection algorithm)
I already tried operators like "loop attributes" and "work on subset" as well as combinations of both. But in the end I was not able to make it so far. Could anyone please provide a clue which approach could be promising?
Kind regards
Sachs
PS: The names and quantity of the attributes may change every time I run the process...
0
Answers
indeed not a trivial problem. The trick is to apply the windowing before a Loop Attributes, and loop the *original* attributes in the operator. Then, inside the loop, you can use a regular expression to select all window attributes that originate from the current attribute.
The problem is, that Loop Attributes has only one input port, and obviously to that port the original attributes are connected. That means that we have to pass the windowed into the loop with a Remember/Recall combination.
Once that is done, two Select Attribute operators are used to split the attribute set into attributes of interest and all other attributes. Do your attribute selection on the interesting ones, and the use Join to join it together with the other attributes.
In the example process below, you can do your stuff in the subprocess called "Do something".
Best regards,
Marius
Hi Marius,
thank you for this example. That looks really advanced!
Just to share some ideas: Here is some code I meanwhile developed but it doesn't work yet.
The main problem is that the loop operator not only does an operation x times but it also provides a result after each operation. That way I receive a collection instead of a single data set. (And in case that I use the "append" operator all the examples are being copied / duplicated.)
So wouldn't it be handy to have a kind of "loop" operator which only repeats an operation several times AND which provides a single data set in the end? Or have a kind of iteration macro in the "work on subset" operator.
Kind regards
Sachs