I need to set absolute value for the following expression
formula Dealt_sigma = |Mean_new - Mean_refrence| /(sigma)
delta_sigma cannot be negative.
Delta_sigma.Expression = "(Convert(mean_new,'System.Double')-Convert(Mean_refrence,'System.Double'))/(sigma)";
Loading

VulpesPosted Mar 19, 2014, 9:23 AM
condition ? a : b
where 'condition' is a bool and 'a' and 'b' are values of the same type.
So, if condition is true, it returns 'a' and, if it's false, it returns 'b'.
Conceptually, it's simple enough though where you have complex expressions, you can drown in a sea of brackets if you're not careful!
Check this link for everything that's allowed in the Expression property:
http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression(v=vs.110).aspx
Farhan ShariffPosted Mar 19, 2014, 7:59 AM
thanks_a_lot Vulpes
VulpesPosted Mar 19, 2014, 7:48 AM
So try this:
Delta_sigma.Expression = "IIF((Convert(Mean_new,'System.Double') - Convert(Mean_refrence,'System.Double')) >= 0.0, Convert(Mean_new,'System.Double') - Convert(Mean_refrence,'System.Double'), Convert(Mean_refrence,'System.Double') - Convert(Mean_new,'System.Double'))/sigma";
Farhan ShariffPosted Mar 19, 2014, 7:42 AM
VulpesPosted Mar 19, 2014, 7:14 AM
To enable me to come up with an answer, can you advise whether the 'sigma' column could be negative or zero?