Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Null values in variable

Hi all,

I'm getting null values stored in the variables. Please could anyone say what I did wrong in the script?


Attached my QVW file. Please help.


Thanks,

Siva.

4 Replies
Anil_Babu_Samineni

Can you make this table in inline with few rows, Will test the same

VarCustomer:

LOAD Distinct Customer as VarCustomer,

     Originformat as IN,

     Destinationformat as OUT

Resident Fields2;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Please find the below data,

LOAD * INLINE [

    Customer, Origin Format, Destination Format

    Crago, HR, X12

    Hapg, HR, X12

    Mrsk, CIDX, GIX

    Addnt, HR, EDIFACT

];

jpitfield
Contributor II
Contributor II

your issue may be here because of empty spaces :

Fields2:

LOAD *,

  if(Len(BusinessInputFieldFlag)=0,'N',BusinessInputFieldFlag) as BIFF,

  if(Len(BusinessOutputFieldFlag)=0,'N',BusinessOutputFieldFlag) as BOFF

  Resident Customer;

Try:

Fields2:

LOAD *,

  if(Len(Trim(BusinessInputFieldFlag))=0,'N',BusinessInputFieldFlag) as BIFF,

  if(Len(Trim(BusinessOutputFieldFlag))=0,'N',BusinessOutputFieldFlag) as BOFF

  Resident Customer;

This will return 0 for nulls and empty spaces

HTH Jim

Anil_Babu_Samineni

Looks good until unless you provide real data.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful