Altair RISE
A program to recognize and reward our most engaged community members
Nominate Yourself Now!
Home
Discussions
Community Q&A
Dynamically accessing the corresponding variables
Shubha
Hi,
I have an exampleset,
A B C D Var_A Var_B Var_C Var_D
23 45 67 89 5 5 5 4
23 45 12 76 6 4 6 3
23 45 67 78 7 3 7 2
87 54 32 23 3 2 8 1
As you see there are four A, B, C, D variables and their corresponding Var_A, Var_B, Var_C, Var_D variables. Now, I need four other columns giving the differences. (say (A-Var_A)...). The result should be:
Diff_A Diff_B Diff_C Diff_D
18 40 62 85
17 41 6 73
16 42 60 76
84 52 24 22
I attach the datafile, data.txt. And the case could be, I will have A, B, C, D, E,F...... variables
[attachment deleted by admin]
Find more posts tagged with
AI Studio
Accepted answers
All comments
TobiasMalbrecht
Hi,
you could use the [tt]AttributeConstruction[/tt] operator to calculate the differences. You could also combine this operator with a [tt]FeatureIterator[/tt] to automatically iterate over attributes and calculate the differences.
Kind regards,
Tobias
Shubha
Thanks Tobias,
I quick question... It seems that i should use two "FeatureIterator" operators (one for A, B, C, D) and the other for 'Var' variables. Am I correct?
Thanks, Shubha
TobiasMalbrecht
Hi Shubha,
no, just use one [tt]FeatureIterator[/tt] and set the attribute regex accordingly. In the [tt]AttributeConstruction[/tt] use the loop macro and generate the difference expressions using that macro.
Regards,
Tobias
Shubha
Thank you very much... It worked...
Quick Links
All Categories
Recent Discussions
Activity
Unanswered
日本語 (Japanese)
한국어(Korean)
Groups