Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello'
i have afiled that its name is status_code.
this filed contian alot of codes' for exsamle:KB,KE,KD,G3,G4,G7,X,Z4...
i want to make group/famlies of code.
i need it becasue i have to count them in groups.
i also need to shw the barcodes that got status codes according to the groups/
the filed of the barcode calld Track_No
barcode | status_code |
---|---|
1234 | G3 |
5678 | KB |
9102 | kd |
987 | z4 |
G3, Z4 =group1
kb,kd=group2
Hi,
LOAD * Inline
[
status_code, GRP
KB,GROUP 2
KE,GROUP 2
KD,GROUP 2
G3,GROUP 1
G4,GROUP 1
G7,GROUP 1
X,GROUP 1
Z4,GROUP 1
];
LOAD *, ApplyMap('COD',Upper(status_code),'OTHER') AS MY_GROUP;
LOAD * Inline
[
barcode,status_code
1234,G3
5678,KB
9102,kd
987,z4
];
EXIT Script;
Hello,
you can use a if clause.
Load
barcode,
status_code,
if(status_code = 'G3' or status_code = 'Z4','Group 1',if(status_code = 'KB' or status_code = 'KD','Group 2')) as Group
from ........;
Exit Script;