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

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Left keep on 3 tables

Hello

I have 3 tables

Table 1 : Article, Désignation

Table 2 : Article, Quantité, Autres

Table 3 : Article, Libellé, Divers

I want to reduce Table 1 with only records where exist in Table 2 or Table 3. Try to use keep left but works only with 2 tables.

Thanks

Labels (1)
4 Replies
Miguel_Angel_Baeyens
Support
Support

Hello,

I'd load first Table2 and Table3, then use Exists() or ApplyMap() to reduce data loaded from Table1:

Table2: LOAD Article, Quantité, AutresFROM Table2; Table3: LOAD Article, Libellé, DiversFROM Table3; ArticleReduceMap: // used for the applymap solution, not needed in the exists solutionMAPPING LOAD Article, 1 AS LoadRESIDENT Table2;CONCATENATE LOAD Article, 1 AS LoadRESIDENT Table3; Table1:LOAD Article, DésignationFROM Table1WHERE ApplyMap('ArticleReduceMap', Article) = 1;// WHERE EXISTS(Article); // will work too without the mapping table


Hope it helps

Not applicable
Author

Thanks for your quick response.

So if i want to do this with exists fonction i only need this code. Exact ?

Table2:
LOAD Article,
Quantité,
Autres
FROM Table2;

Table3:
LOAD Article,
Libellé,
Divers
FROM Table3;

Table1:
LOAD Article,
Désignation
FROM Table1 WHERE EXISTS(Article);
Miguel_Angel_Baeyens
Support
Support

That's correct.

This maybe faster (I haven't tested so far) if both Table2 and Table3 are large tables, since the Resident load proposed for the mapping table may take long to load. But as EXISTS() also discriminates results, if performance is an issue, you should try both.

Regards.

Not applicable
Author

Thank you very mutch. I will try this.