Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Remove Records in script

I have two table, one with detail records (TableDetail) and the other (Table Status) hold the records status (which can be more then one). The link between the two tables is an Order Number. If in TableStatus one of the status's for say Order Number 123 is 1 then I do not want to bring in the record from TableDetail at all in the script.

How do I do this in the script?

Thanks,
Stephen

14 Replies
Not applicable
Author

You can find an example here: [View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Components.UserFiles/00.00.01.15.11.Posted/DeleteRows.qvw]

Not applicable
Author

Yes, my example would do that. Didn't realize you had multiple order statues. IF the example posted doesn't work let me know and I can write one for you. I think his will work good though.

Not applicable
Author

Damián, thanks got it working.

Stephen

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I guess, I'm a bit late with this suggestion, but... the easiest way to accomplish what you need is through mapping. Consider the following:


Table1:
load
OrderID,
...
Status
...
;
StatusMap:
mapping load
IrderID, Status
Resident Table1
;
Table2:
load
OrderID,
...
from ...
where
ApplyMap('StatusMap', OrderID) <> 1
;


This way, the unwanted rows never make it to the database in the first place. I have a Wiki page about Mapping where I explain it in more detail...

Ask me about Qlik Sense Expert Class!
Not applicable
Author

Oleg,

Won't this approach leave the order if it also has a status of 2? I need the entire order removed, not just the status 1 part.

Stephen