Cool way to calculate inline MAX of two values in MS SQL
— The following expression calculates ==> max(@val1, @val2)
SELECT 0.5 * ((@val1 + @val2) + ABS(@val1 – @val2))
Kudos to splattne.
(Used in Demand Forecasting calculation project)
Business Analysis, BI and Reporting, Project Management
— The following expression calculates ==> max(@val1, @val2)
SELECT 0.5 * ((@val1 + @val2) + ABS(@val1 – @val2))
Kudos to splattne.
(Used in Demand Forecasting calculation project)