Hello,
I am applying a simple formula (screengrab below), the formula is not returning me with the else value i.e "0".
Not sure what am i missing here, please assist.
Thanks!
Solved! Go to Solution.
@deepsingh Can you provide an example of a record (the values of OrderID, u11 and Action Name) that you think should be returning "0"? Your formula seems as though it's setup correctly syntax wise.
Observations:
It looks like you are going to return the values of 0 & 1. I would use a numeric data type of "Boolean" for these values. If you want a string "0" and "1", then I would use STRING with a length of 1.
The IF statement has 2 conditions being tested. When either condition is True, or more specifically in any case where the first condition is true plus those conditions where the first condition is false and the second condition is true, then the result is 1. The default value of 0 is set when the condition tests are not true.
Recommendation:
Summarize your data (Group by Order_id, ull, Action Name & count of Order_id) and view the results to see if you should get any 0 results. The logic itself looks reasonable. Here is another construction of the logic:
IF Contains([Action Name], "HMS_bModify_ORDER") THEN 0 ELSEIF !sNull([Order_id]) && !IsNull([ull]) THEN 1 ELSE 0 ENDIF
I chose to write the statement this way to illustrate that whenever the Action Name includes the "HMS_bModify_Order" text, that you want the value to be 0. The ELSEIF looks to see if the other variables have ANY value (including space or '') that the result is 1. The else condition would only occur with a NULL value to either Order_id or to ull. It doesn't matter what value ull has.
Another statement would be:
IF !IsNull([Order_id]) and !IsNull([ull]) and Contains([Action Name],"HMS_bModify_Order") THEN 1 ELSE 0 ENDIF
Cheers,
Mark
I think I have got the answer to this one (the other reply by @MarqueeCrew).
Thank you for your time on this, appreciate that.
Thanks!
Hello MarqueeCrew
Thank you for the response.
We are still not getting the desired output, also in the actual formula the Action Name is not equal to HMS_bModify_ORDER (The updated formula shown below)
IF !IsNull([Order_id]) and !IsNull([u11]) and [Action Name] != "HMS_bModify_ORDER" THEN 1
ELSEif !IsNull([Order_id]) and Contains([u11], "-new") and Contains([Action Name], "HMS_bModify_ORDER") THEN 1
else 0
Endif
After the formula we have used select function to change the Broadband field type to Double, we are still getting 1 as a result.
Let me know if you need any more details.
Thanks!
Hello patrick_digan
This is stil unresolved, providing few examples of the OrderID, u11 and Action Name where the result is suppose to be 0.
Action Name:
HMS_bConsolidateCart_ORDER
HMS_bGMOTT_ORDER
u11 would be blank
OrderID:
22-238235102266043
22-538236384944416
Please do let me know if you need more details.
Thanks!
@deepsingh It is working as I expected in the attached. Perhaps you're having an issue with null vs blank in u11? Notice that a true null will produce a 0 in broadband while a blank will produce a 1.