Unanswered: SQL Newbie - Conditional Calculation - Best Practice?
I hope someone can help with this.
I want to create a view with 5 columns:
[condition], [value1], [value2], [value3], [calculation]
The calculation is based on the value of the condition e.g.
Condition = A: Calculation is [Value1]+[value2]+[value3]
Condition = B: Calculation is [Value1]*[value2]*[value3]
Condition = C: Calculation is [Value1]/[value2]/[value3]
I thought I could add an IIF statement to the calculation field or i could group all the same conditions in one view, perform the calculation then create a new view joining all the views for the different calculations.
Has anyone had experience with this who could steer me in the right direction.