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
Mathematical comparison between same attributes names of two different data-set
achint_kumar
Member Posts: 16 Contributor II
Mathematical comparison between same attributes names of two different data-set based on placement of the attributes. I have 24 attributes each in two data sets, i need to do calculation from first dataset 1st attribute against 1st attribute of second data set. I don't want to pick the attribute name hardcoded, but i need it dynamic as the month name will differ from time to time.
Consider the attached dataset as both datasets(same attribute but different values)
I need to do calculation in 1st attribute (multiply, divide, etc) and compare the value of the same attribute in second dataset. Hope the requirement is clear. Im trying to make this as dynamic as possible. The placement of the attributes in exactly the same in both dataset(along with exact same name)
Looking forward to hearing from you all. Thank you.
Consider the attached dataset as both datasets(same attribute but different values)
I need to do calculation in 1st attribute (multiply, divide, etc) and compare the value of the same attribute in second dataset. Hope the requirement is clear. Im trying to make this as dynamic as possible. The placement of the attributes in exactly the same in both dataset(along with exact same name)
Looking forward to hearing from you all. Thank you.
0
Best Answer
-
hbajpai Member Posts: 102 UnicornHey @achint_kumar ,
If I understand your requirements correctly, I think the best way would be to transpose the dataset so that Months are your row indexes and your attributes represent YearMMc. Then you can compare and calculate on the rows through the same indexes by using the operator 'Filter Example Range'.
Another way if your database is consistent in terms of the number of months in both datasets is by using the operator 'Rename by Generic Names' to have attributes name represent the column indexes. This way you can have consistent attributes name for comparison between datasets.
What do you think will be a better approach for you?Best,
Harshit6
Answers
what's the meaning of the first column? You have duplicates in there.
Would you join the second example set to the first one, based on some criterion?
If you join two example sets based with identical column names, the attributes from the second one get a postfix attached ("_from_ES2").
If the data sets are joined this way, you can do a Loop Attributes with the appropriate selection regular expression ([a-zA-Z]+-[0-9]+). This will select the attributes from the original example set. Then you do something like Generate Macro inside the loop to append the _from_ES2 postfix, and use Generate Attributes with the loop attribute macro and the generated attribute name macro, and your formula.
Regards,
Balázs