6 Replies Latest reply: Oct 30, 2013 12:29 PM by Antonin Ramet RSS

    Add 2 fields in mapping

    Antonin Ramet

      Hi there,

       

      I'm like a newbie in Qlikview, and I've got a little something that I can't make. Right now, I've got this :

       

       

      agent:

      MAPPING LOAD * inline [

      Old ,New

      "MO", "Maladie ordinaire"

      "AT", "Accident de travail"

      "MA", "Maternité"

      "ML", "Longue Maladie"

      "MD", "Longue durée"

      ];

       

      map[raison] using agent;

       

       

      But the thing is, to build "Maternité", I need more that the code "MA", I need also the code "CP" and the "GP" one. So in this way, the number of MA will add itself to the CP one, and to the GP one, to build the "Maternité" right number.

       

      FYI : the agent table is build that way (for a month, we count the amount of day missed, and why. If there are two reasons, you've got the amount of time for the first reason, and on an other line, the second one)

       

      LOAD

           IDF_AGENT,

           NUM_ANNEE as num_annee,

           NUM_MOIS as num_mois,

           count(NUM_JOUR) as NbJourAbsence,

           COD_ARRET as raison

      RESIDENT

           table_calendrier

      GROUP BY

           IDF_AGENT,NUM_ANNEE,NUM_MOIS,COD_ARRET;

       

       

      How to do that ? Thanks a lot !

        • Re: Add 2 fields in mapping
          Stefan Wühl

          Could you please post some sample lines of your data and your requested result for those records?

           

          Map raison using agent;

           

          is just mapping your input values to the values in your mapping tables when storing them to the internal table, it seems hard to apply any additional logic at that point.

            • Re: Re: Add 2 fields in mapping
              Antonin Ramet

              So I want smth like that :

               

               

              IDF_AGENTNUM_MOISNUM_ANNEENbrJourAbsenceRaisonFamille
              1220123CPMaternité
              1220125MAMaternité
              15201225GMGrave Maladie
              512201130MPMaladie Professionnelle

               

              I've got 13 differents codes, and I want to regroup them by "family".

               

              Code => Familiy

               

              CP-GP-MA => "Maternité"

              GM => "Grave Maladie"

              ...

               

              The "Map raison using agent;" is something I tried, but it was a failure !

               

              But right now, I'm not able to find the solution for the "Family" row, and I thought it was something in the mapping.