Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Create a table with unique list

Hi Forum,

 

I have this table

Mat DescMaterial NumberSubMat1SubMat2SubMat3SubMat4SubMat5
xxx103842390065821003623114380563843090505null
xxx103842390065824375805010036231139005639null
xxx10384244058607nullnullnullnull
xxx103842390065824375805010036231039005637null
xxx1038423900658210036231139005638nullnull
xxx1038423900658243676069nullnullnull
xxx103842390065821003623114380563841162738null
xxx1038423900658210036231143676069nullnull
xxx103842390065824375805010036231040715734null
xxx103842390065821003623114380563840221880null
xxx10384239006582437580501003623103900666039006921

 

from which i would like to create another table

 

Mat DescMaterial NumberSub Components
xxx 103842All unique subcomponents from columns SubMat1 - SubMat5
  ..
  ..

 

Could some one help me with this.

 

Thanks in advance.

  • You should unpivot your data to make this easier. In the query editor, select the first two columns, right click on them, and choose unpivot other columns. Once you load that table, you can use a measure with CONCATENATEX() to combine the values for each material in a table visual.

     

    Pat

     

2 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    You should unpivot your data to make this easier. In the query editor, select the first two columns, right click on them, and choose unpivot other columns. Once you load that table, you can use a measure with CONCATENATEX() to combine the values for each material in a table visual.

     

    Pat

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Pat ! I am nearly there.

       

      The table I see now is

       

      Mat DescMat NumberAttributeValue
      xxx123Sub Nameyyyyy
      xxx123Sub Number3456
      xxx123Sub TypeType 1

       

      How do it convert this to.

       

      Mat DescMat NumberSub NameSub NumberSub Type
           

       

      TIA.