Forum Discussion

Venson's avatar
Venson
Frequent Visitor
2 years ago

Mapping data based on the column header and content

Hi everyone,

Thanks for your times here.

I got one request is to review vendor's response and auto mapping the result.

Tried some method but fail,

Below is my raw data. hope can have your kindly support here. many thanks 🙂

 

1. In the database, we have all vendor information, specification and key attribute as below

SpecAttribute1Attribute2Attribute3Attribute4vendorproduct
SpecAYesNoACaa1
SpecAYesNoACaa2
SpecBYesYesACaa3
SpecCYesYesBDbb1
SpecDNoYesBDbb2

 

2. next step, our manger define a checklist questions base on different kind of attribute as below.

ChecklistAttribute requirement
Question1Attribute1(yes) and Attribute2(yes)
Question2Attribute1(yes) and Attribute3(A)
Question3All
Question4Attribute1(yes) or Attribute3(B)

 

3. next step, we collect "vendor a" and "vendor b" response which product they checked, two tables as below

ChecklistAttribute requirementProduct
Question1Attribute1(yes) and Attribute2(yes)a1 ; a2
Question2Attribute1(yes) and Attribute3(A)a1
Question3Alla1
Question4Attribute1(yes) or Attribute3(B)a1

 

ChecklistAttribute requirementProduct
Question1Attribute1(yes) and Attribute2(yes)b1
Question2Attribute1(yes) and Attribute3(A)b1
Question3Allb1 ; b2
Question4Attribute1(yes) or Attribute3(B)b3

 

Final mapping result I'd like to show on dashabord.

ChecklistAttribute requirementProductMapping successMapping missMapping wrongMapping success countMapping miss countMapping wrong count
Question1Attribute1(yes) and Attribute2(yes)a1 ; a2 ; b1b1a3a1 ; a2112
Question2Attribute1(yes) and Attribute3(A)a1 ; b1a1a2 ; a3b1121
Question3Alla1 ; b1 ; b2a1 ; b1 ; b2a2 ; a3N/A320
Question4Attribute1(yes) or Attribute4(C)a1 ; b3a1a2 ; a3 ; b1b3131

4 Replies

  • Daniel29195's avatar
    Daniel29195
    Community Champion

    Venson hello, 

     

    kindly find attached thee file . 

    https://drive.google.com/file/d/1PBjdX9cFc2hCL_gMg6dCzGUdZ8Jk7NFA/view?usp=sharing

     

    if this is what you want, you need some transformations on your data to be able to get the output you want .

    i didnt create all the required measures, cz the measures will be same as the second one, just you need to change the conditions in the switch statement in the code .

     



    hope this makes sense to you .

     

     

     

     

    best regards. 

    • Venson's avatar
      Venson
      Frequent Visitor

      Hi Sir, many thanks 🙂 !!

      as you mentioned, might need some transform from row data to achieve the table 4 as yours, I can combine two vendor's reponse trough feature "apped", but don't know how to make it become seperated row, for example, vendor a put product a1 ; a2 for Quesiton1, and I tried some pivot or tranpose still can't make it become two row, may please help me ?

      • Daniel29195's avatar
        Daniel29195
        Community Champion

        Venson 

        i will help you out dont worry 

        to expand the a1 ; b1 to multiple rows,  follow the following steps : 

         

        step1 :  go to poewr query

        step2 :  select the table in question

        step3 :  select the column in question 

        step 4 ; go to transform 

        step 5 :  under transform choose --_>  split colums --> by delimiter 

         

        step 6 : configure as below : 

         

         

        done 

        this will expand the row into multiple rows. 

         

         

         

        if this helps you, dont forget to hit that thumbs up 👍 button . 

         

        let me know if you have any further questions  .