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
"Macro to calulate % of a value"
Hi Matthias and all,
I want to write a macro to calulate 20% ( percent ) of a value. My problem is like this
CUST_ID TRAN_COUNT
--------------------------------------
23145 23
34562 87
I want to Iterate the process for each CUST_ID and In the inner loop I am reading data belongs to CUST_ID and I am passing it to "Outlier Analysis".
In Outlier Analysis I need to give input 'count_of_outlier' as 20% of TRAN_COUNT.
I am taking macro "extract macro" .....But How can I calulate % of that value?
Thank you
Yours
Anki
I want to write a macro to calulate 20% ( percent ) of a value. My problem is like this
CUST_ID TRAN_COUNT
--------------------------------------
23145 23
34562 87
I want to Iterate the process for each CUST_ID and In the inner loop I am reading data belongs to CUST_ID and I am passing it to "Outlier Analysis".
In Outlier Analysis I need to give input 'count_of_outlier' as 20% of TRAN_COUNT.
I am taking macro "extract macro" .....But How can I calulate % of that value?
Thank you
Yours
Anki
0
Answers
if you already have the value extracted as a macro, you can generate a new one using expressions via "Generate Macro". Here a small example illustrating this. "Generate Attributes" is just used to show the computed macro value. Instead of generating output this way, you will have to use the new macro as input parameter for "Outlier Analysis". You will certainly need integer values, so you can wrap the "Generate Macro" expression included above inside the ceil() or floor() function, e.g. ceil(%{tran_count} * 0.2)
Best regards
Matthias
Thanks a lot.
Yours
Anki