Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am struggling with the loading script using IF below, appreciate anyone's help :
[TCODE]:
LOAD fileNumber
if(([trackCode]='BOOKED') AND [TransportMode]={'B','V'}) as TB
if(([trackCode]='BOOKCONF) AND [TransportMode]={'P','T'}) as TD
resident [Shipment];
The shipment already has trackCode and TransportMode fields, the problem is the syntax error.
Thank you.
Regards,
AG
Your if() statements need at least a THEN branch, and check your string value matching, like
if(([trackCode]='BOOKED') AND Match([TransportMode],'B','V'), 'Yipiieh!' ) as TB
May be try this:
[TCODE]:
LOAD fileNumber
If([trackCode]='BOOKED' and WildMatch([TransportMode], 'B','V'), 1, 0) as TB
If([trackCode]='BOOKCONF' and WildMatch([TransportMode], 'P','T'), 1, 0) as TD
Resident [Shipment];
ur missing single quote
[TCODE]:
LOAD fileNumber
if(([trackCode]='BOOKED') AND [TransportMode]={'B','V'}) as TB
if(([trackCode]='BOOKCONF') AND [TransportMode]={'P','T'}) as TD
resident [Shipment];
Hi,
Please try this..

Regards,
Saniya
Hi,
It means i think Missing the single Quote![]()
The shipment already has trackCode and TransportMode fields, the problem is the syntax error.
Extending to sunny syntax, we can use below in Red to give a meaningful name using Dual
[TCODE]:
LOAD fileNumber
If([trackCode]='BOOKED' and WildMatch([TransportMode], 'B','V'), Dual('TransportModeBV',1), Dual('TransportModeNOTBV',0)) as TB
Resident [Shipment];