Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have following script which is not working Properly as i have used three Conditions using "AND" .It works good when i use two condition with one "AND". Is there solution to for applying three criteria in IF condition?
if((Not IsNull("Customer Name Today") and Not IsNull("Customer Name Yesterday") and [Customer Name Today]=[Customer Name Yesterday]),'No Change',
if((Not IsNull("Customer Name Today") and Not IsNull("Customer Name Yesterday") and [Customer Name Today]<>[Customer Name Yesterday]),'Change',
Could any one please help me to work on the right approach towards this issue ?
Thanks
Hi Moni, there should be no problem using many "ands", what it's happening and what's the expected result?
You can create a simple table to check the data and see what is happening:
Dimensions (check in both 'supress null values'):
- "Customer Name Today"
- "Customer Name Yesterday"
Expression:
If("Customer Name Today"="Customer Name Yesterday", 1, 0)
You can sort by expression to group them and follow the result of the conditionals.
Hi,
This is my full formula. I need this Column should be used in the table. On using this formula it is not displaying 2nd and 3rd Condition alone.
if((IsNull("Customer New Today") and IsNull("Customer Old Yesterday")), 'No Change',
if((Not isNull("Customer New Today") and Not IsNull("Customer Old Yesterday") and ([Customer New Today]=[Customer Old Yesterday])),'No Change',
if((Not isNull("Customer New Today") and Not IsNull("Customer Old Yesterday") and ([Customer New Today]<>[Customer Old Yesterday])),'Change',
if((IsNull("Customer New" Today) and Not isNull("Customer Old Yesterday")),'Deletion',
if((not IsNull("Customer New Today") and IsNull("Customer Old Yesterday")),'Addition'))))) as [Customer LineType]
Hi,
Below might be compact one to use.
Here is your scenario :-
Customer New Today | Customer Old Yesterday | Result |
NULL | NULL | No Change |
ABC | ABC | No Change |
ABC | ABCD | Change |
NULL | ABC | Deletion |
ABC | NULL | Addition |
Formula :-
IF((isNull([Customer New Today]) and isNull([Customer Old Yesterday])) or [Customer New Today]=[Customer Old Yesterday],'No Change',
if(isNull([Customer New Today]),'Deletion',
if(IsNull([Customer Old Yesterday]),'Addition',
'Changes'
)
)
)
Regards,
Ravi Balar
The only typo I see is the double quotes on the 'Deletion' line:
- if((IsNull("Customer New" Today) and Not isNull("Customer Old Yesterday")),'Deletion',
Should be:
if((IsNull("Customer New Today") and Not isNull("Customer Old Yesterday")),'Deletion',
The expression posted by Ravi is more clean and easy to manage.