18 Replies Latest reply: Jul 6, 2015 10:48 AM by Willy GARNIER RSS

    Need help with Set Analysis and test like "if exists" (QVW in)

    Willy GARNIER

      Hello,

       

      First I have joined a QVW to show you what I want to do.

       

      I have several lines with:

      - Code_article = Item number

      - Code_depot = depository

      - Num_Contrat = contract number

       

      Others are less important for the understanding.

       

       

      Code_ArticleCode_DepotNum_ContratPalierSerie_economique
      11111
      11120
      121101
      1231001
      21210001
      21220000
      44430000
      44444441
      44455550
      4446666

      0

       

      For each combination of Code_article , Code_depot , Num_Contrat  I have one line with "Serie_economique" = 1.

       

      I want one line for each so:

       

       

      Code_ArticleCode_DepotNum_ContratFiltrePalier
      111OK1
      121OK10
      123OK100
      212OK1000
      444OK4444

       

      I have made a filter to show only these lines.

       

      It is OK, I have these lines

       

      But I want more

      I would like to know if another line exists with "Serie_economique" = 0 and more, the min value with "Serie_economique" = 0 which is superior to the one with "Serie_economique" = 1 ...

       

      Something like that:

       

      Code_ArticleCode_DepotNum_ContratFiltrePalierTest
      111OK12
      121OK10
      123OK100
      212OK10002000
      444OK44445555

       

      I need help for column "Test" in this table.

       

      You can see my tests in the QVW but I can not find the good expression. I only tried to find teh max value for the combination of Code_article , Code_depot , Num_Contrat before doing more complex case.

       

      But I always have:

      - the same value as "Palier"

      - the max value of all the table

       

      I can not do it in my script because my real need is much more complicated

       

      With my example, I want to understand how it is working in a "simple" qvw.

       

      Help me please to understand why and how to solve my problem.

       

      Thank you,

      Willy