Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Got a new question going slightly beyond the question I asked in the morning.
Assume the table I am referring looks as below,
Item_Code | Item_Name |
CBDG3CD | A |
124567 | D |
DEFACD | E |
243671 | G |
CD | H |
AGHDK2 | N |
CD | M |
This time I want to filter the data based on the below requirements;
1. Select the last two characters of the Item_Code.
2. I want to Flag/Filter the Item_Codes which ONLY got "CD" letters at the END.
Note
Item_Code could just "CD" or it could be the last two letters of a text value.
The out put should be something like below,
Item_Code | Item_Name | Flag |
CDBG3CD | A | 1 |
124567 | D | 0 |
DEFACD | E | 1 |
CD3671 | G | 0 |
CD | H | 1 |
AGHDK2 | N | 0 |
CD | M | 1 |
Could anyone help me with the above task, would be greatly appreciated.
Regards,
Andy
Hi,
I used the below command but it did not give me the correct answer,
If(Right(Item_Code,2)= 'NC',1,0) as Flag
Could you please correct me on the above statement?
Thanks in advance
Regards,
Andy
Hi Andy,
Test:
Load *,
If(Right(Item_Code,2)='CD',1,0) as Flag;
Load * Inline [
Item_Code,Item_Name
CBDG3CD,A
124567,D
DEFACD,E
243671,G
CD,H
AGHDK2,N
CD,M
];
Its working Andy. Where do you find issue?
Regards,
Nitin G.