ADDCOLUMNS function adds additional columns to a specified table. The result of the function is a new table that includes the original columns of the source table, plus the new columns.
ADDCOLUMNS(Table, "New Name 1", COLUMN_EXPR1, "New Name 2", COLUMN_EXPR2, ...)
The first argument must be a table expression, such as form id or another table function.
Following the table argument, the function accepts pairs of column names and expressions. Each pair results in an additional column in the resulting table.
Suppose you have the following table with records containing the amounts for loans issued denominated in Euros.
|Loan ID||Loan amount in EUR|
Say that you will need to analyze this data in US dollars. You can use
ADDCOLUMNS to add a column to this table that contains the equivalent in USD.
Assuming that the exchange rate to apply across all loans is 1.1, your formula would be:
ADDCOLUMNS([Loans], “Loan amount in USD”, [Loan amount in EUR]*1.1)
The result of this function would be:
|Loan ID||Loan amount in EUR||Loan amount in USD|
The resulting table will include the existing columns from
[Loans] and a new column "Loan amount in USD" calculated as the product of the loan amount in Euros and the exchange rate you set in your formula.