5 Replies Latest reply: Jan 3, 2017 6:45 PM by Rafael Vidal RSS

    Using "where exists" to match fields between two tables.

      Hello! I am trying to reduce some massive tables (with Basketball teams results mainly) to small ones (I have them for several countries and I only need one of them right now), as well as the tables with the teams.

      I manage to reduce the table with the matches with a simple "Wildmatch" using the country code, to reduce the second table I thought of using where exists and the Field "Team ID" since this field is the link between tables. But if I do it as it follows, I get the full table and (even though I am pretty new in QlikView) I understand why.

      Is there any way to use something like "where exists ([Team ID]) in MATCH" ? So when I am creating "TEAMS_2" it only takes the teams which Team ID is in the reduced "MATCH_2" table?


      I know it'd be easier to do if I had the field "Country" or something like that in TEAMS but because of how we get the info it is impossible.




      LOAD *

      Resident MATCH

      where WildMatch (Country ,'SPAIN')>0 ;


      Drop Table MATCH;





      LOAD *

      Resident TEAMS

      where Exists ([Team ID] ) ;




      Thank you in advance!