Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've two fields, "CreditStatus" and "ProdOrder".
I need new field like "SortCodes" with with some if conditions.
CreditStatus --------------------------------> SortCodes
- (Null data) 0
B (With No "ProdOrder" data) give me 1
B (With "ProdOrder" data) give me 2
A&D ( With No "ProdOrder" data) give me 3
A&D ( With "ProdOrder" data) give me 4
I tried following but not worked. Need help!
if(match(CreditStatus,' '),'0',(if(match(CreditStatus,'B' and IsNull(ProdOrder)),'1',
(if(match(CreditStatus,'B' and (ProdOrder)),'2',
(if(match(CreditStatus,'A' or 'D' and IsNull(ProdOrder)),'3',
(if(match(CreditStatus,'A'or 'D' and (ProdOrder)),'4'))))))))) as Sortcodes
Try this:
If(Len(Trim(CreditStatus)) = 0, 0,
If(CreditStatus = 'B' and Len(Trim(ProdOrder)) = 0, 1,
If(CreditStatus = 'B' and Len(Trim(ProdOrder)) > 0, 2,
If(Match(CreditStatus,'A', 'D') and Len(Trim(ProdOrder)) = 0, 3,
If(Match(CreditStatus,'A', 'D') and Len(Trim(ProdOrder)) > 0, 4))))) as Sortcodes
Try this:
If(Len(Trim(CreditStatus)) = 0, 0,
If(CreditStatus = 'B' and Len(Trim(ProdOrder)) = 0, 1,
If(CreditStatus = 'B' and Len(Trim(ProdOrder)) > 0, 2,
If(Match(CreditStatus,'A', 'D') and Len(Trim(ProdOrder)) = 0, 3,
If(Match(CreditStatus,'A', 'D') and Len(Trim(ProdOrder)) > 0, 4))))) as Sortcodes
thanks Sunny:-)