Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Restricting a load by a specific field result

I have created a If statement

If( Len(Trim([Mat. Doc._WABLNR.AFRU]))>0, '1', '0') as Null.  I only want to load the 1's.  I am trying to figure out if I can write a formula to only load the items with the 1 result but am not having great success. 

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

If you use that formula in the script you may write:

Load

...

Where Len(Trim([Mat. Doc._WABLNR.AFRU]))>0


otherwise if you use the formula as dimension


you may write:


If( Len(Trim([Mat. Doc._WABLNR.AFRU]))>0, '1', Null())


and check the box exclude null values

Not applicable
Author

Not to sound dense but I am having a hard time figuring out where to insert the Where statement. I have the below but the Where statement is obviously not in the right place.

LOAD

AS DATE,

AS ObjectID,

Plant_WERKS.AFRU AS Plant,

Yield_GMNGA.AFRU AS QuantityLabored,

AS MaterialDoc,

Type.conf._MANUR.AFRU,

Order_AUFNR.AFRU AS ProductionOrder,

If( Len(Trim())>0, '1', '0') as Null

Where Len(Trim())>0

FROM

…..

alexandros17
Partner - Champion III
Partner - Champion III

The syntax is:

LOAD

....

FROM

      …..

WHERE  Len(Trim([Mat. Doc._WABLNR.AFRU]))>0

I think that

LOAD

      AS DATE,

leads you to an error, you need to specify a field that is renamed as DATE (something like Load myField as DATE)

Hope it helps