16 Replies Latest reply: Jul 10, 2017 3:18 PM by Sunny Talwar RSS

    Selection from a selection, is that possible?

    Aksel Etingu

      Dear all,

       

      I am an SQL user, so the solution to my problem on SQL would be simple, but I would like to know if this could be done within Qlikview.

       

      You have a table:

       

      Month  Client     Balance  Flag

      May    A            100           1

      May    B            200           1

      April    A            50             1

      April    B           150            0

       

      I wan't to get the clients in the latest available month (A and B) and get their historic balances.  In SQL that would be a select within another select. (to give me history for both A and B, excluding C)

       

      The issue in Qlikview is that I apply a filter on the flag for 1 so I need data where Flag is one in May.  As with every corporation, there are data flaws, so if this is run the data I would get would be 300 for May and only 50 for April.  So I want to use the filter to get the right set of clients to my latest month(or designated) and once I have this, pull the data for all within this distinct clients list to give me 300 for May and 200 for April including Client B who is flagged zero.

       

      Complex ask, but help is very much appreciated.

       

      Regards,

      Aksel