Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
dftoomey
New Contributor II

Load not Pulling Previous Fields

Hello,

My load statement is as follows:

NoConcatenate

GMR:

Load

*,

     [Posting Date] as CalendarDate,    

     ApplyMap('PC_Mapping', MappingKey, 'Not Mapped') as [Profit Center Desc.],

     ApplyMap('CC_Mapping', MappingKey, 'Not Mapped') as [Cost Center Desc.],

     ApplyMap('IS_Mapping', MappingKey, 'Not Mapped') as [I/S Mapping],

     ApplyMap('FS_Mapping', MappingKey, 'Not Mapped') as [F/S Mapping],

     ApplyMap('AT_Mapping', MappingKey, 'Not Mapped') as [Account Type],

     ApplyMap('FST_Mapping', MappingKey, 'Not Mapped') as [F/S Tab],

     ApplyMap('GMGL_Mapping', MappingKey, 'Not Mapped') as [GM G/L Category],

     if([Billing Type]='ZRE',Quantity * -1,if([F/S Mapping]='Sales Discounts','0',Quantity)) as [Adjusted Qty]

                              //if([Billing Type]='ZRE',Quantity * -1,Quantity) as [Adjusted Qty]

Resident BSEG2

;

Drop Table BSEG2;

For some reason when this is run the second nested "if" does not recognize the field "[F/S Mapping]" and the load fails. I have used the commented portion before and it worked fine. The "[Billing Type]" is contained in the previous tables leading to this. Any thoughts on why this wouldn't work?

Thanks

1 Solution

Accepted Solutions
mwoolf
Honored Contributor II

Re: Load not Pulling Previous Fields

     if([Billing Type]='ZRE',Quantity * -1,if(ApplyMap('FS_Mapping', MappingKey, 'Not Mapped')='Sales Discounts','0',Quantity)) as [Adjusted Qty]

1 Reply
mwoolf
Honored Contributor II

Re: Load not Pulling Previous Fields

     if([Billing Type]='ZRE',Quantity * -1,if(ApplyMap('FS_Mapping', MappingKey, 'Not Mapped')='Sales Discounts','0',Quantity)) as [Adjusted Qty]