Hi! I’m trying to apply a function to a table. The basic idea is that if the 2 prices adds up to 0, then the new column gets 0, otherwise it gets the product of the 2 prices. However I encountered _’ type _error.
Using the vector conditional or applying a function to the columns are both valid solutions that work.
The vector conditional would be the best approach as it is more efficient to use. Due to the fact that it is doing the calculation within the query and doesn’t have to do an each on each value to get the entry for the new column.
As shown below using a table of 1 million rows, the difference can be seen for either approach