matchHeaders function

The matchHeaders function returns the value in the corresponding row for the selected column.






Returns the value of the corresponding row of the specified column. Column is a mandatory parameter.

Example - matchHeaders(column)

The following examples use the Commissions dataset.



In this simple example, there are three possible commission rates for our salesforce, according to the contract selected by the client and their age group.

The commission type to be applied is automatically applied in the Commission Type column with the formula: ifelse($"Contract_Type"=="A","Commision 1",ifelse($"Age"<25,"Commission 2","Commission 3"))

We can now use the matchHeaders function to apply the correct commission percentage, according to the type selected.

To do this we simply create a new column called Commission Applied, and enter the formula matchheaders($"Commision Type).

The formula has retrieved the corresponding commission rate from the correct column, according to the type identified in the Commission Type attribute.

The advantage to working in this way is that if commission rates change, or vary according to the day or sales person, or the conditions change, it's really quick to retrieve the new values for each sale.