Dear all,
I'd like to know if there is a possibility to use macros by refering to them via column content. The selection, which predefined macro shall be used, is depending on the content of a specific column.
A simplified example
Input table
country |
base_value |
result_value |
---|
GER |
10 |
? |
USA |
5 |
? |
Available macro variables
m_multiplier_GER: 2
m_multiplier_USA: 3
I want to calculate result_value by multiplying the base_value with the value of the macro matching the country in its very own name.
Expected result
country |
base_value |
result_value |
---|
GER |
10 |
20 |
USA |
5 |
15 |
In an "Generate Attributes" operator, I'd need something like [result_value= base_value * %{m_multiplier_country@}] where "@" represents some sort of escape character to be able to include the column content in the macro name.
My current solution is to put the macro information in a table and merge it via the country column. However this produces a lot of duplicated information in my table, which I have to carry through my process and remove afterwards. The process contains of multiple steps that each need different macro information each.<\p>
I hope to find a more elegant solution that allows me to use the macros directly.
Thanks for the help
Denis Wolfrath