6 Replies Latest reply: Mar 5, 2013 6:21 AM by Caroline Massin RSS

    How to count distinct value depending on some other tables/values

      Hi everyone,

       

      I have been searchin and trying for a long time but I'am stuck with this problem .

      I really need help.

      I am sure there is an easy QlikView solution..

       

      I have 2 tables: Transport and vehicules.

      In my table vehicule, only some of them are available for transport.

      Transport occurs to a date.

      Vehicules can make more than one transport the same day.

      I need to count the number of different vehicules that have been working per day and those that haven't benn working that same day in comparison to my number of available vehicules .

       

      Exemple of data

       

      Tables:        TRANSPORT                       VEHICULE

                          Date           Vehicule            Vehicule   Available?

                         01/01/2012  A                       A             Y   

                          01/01/2012  A                       B             Y

                          01/01/2012  A                       C             Y

                         01/01/2012  B                       D             Y

                         01/01/2012  C                       E             N

                         02/01/2012  A

                         02/01/2012  B

                         02/01/2012  B

                         02/01/2012  A

                         03/01/2012  C

                         03/01/2012  C

                         03/01/2012  C

       

      So here, I have a total of 4 vehicule available.

      on the 01/01/2012, 3 out of 4 were actually active and 1 out of 4 was inactive.

      on the 02/01/2012, 2 out of 4 were actually active and 2 out of 4 was inactive.

      on the 03/01/2012, 1 out of 4 were actually active and 3 out of 4 was inactive.

       

      Seems really to be easy but I can't get trhough even with set analysis..

       

      Thanks for your help !!!

       

      caroline .