Forum Discussion

anaib's avatar
anaib
Frequent Visitor
2 years ago
Solved

Evaluate text field value and create a column based on unique occurrences

Hello everyone,

I have a huge data center usage dataset that contains a colum "EquipmentId".  The Equipment ID colulmn contains alpha numerical values.  In a million plus rows, there are a couple of hundred unique equipment Ids.  I need create a column that associates each unique equipment Id to IT department.  

I have it working by using IF statements but it's not a very elegant solution, IMO.  Looking for your help on how this can be done perhaps by inserting another table etc.?

 

Here is the sample dataset:

EquipmentIdCostDatacenterDate
123456abc100South1/3/2024
98765xyz104North1/4/2024
87234234kj201South2/1/2024
9876234bs300South2/5/2024
27342asdf100North2/8/2024
123456abc219.8South1/3/2024
98765xyz239.4South1/4/2024
87234234kj259North2/1/2024
9876234bs278.6South2/5/2024
27342asdf298.2South2/8/2024
123456abc317.8North1/3/2024
98765xyz337.4South1/4/2024
87234234kj357South2/1/2024
9876234bs376.6North2/5/2024
27342asdf396.2South2/8/2024
123456abc415.8South1/3/2024
98765xyz435.4North1/4/2024
87234234kj455South2/1/2024
9876234bs474.6South2/5/2024
27342asdf494.2North

2/8/2024

 

I have a separate table with all unique equipment Ids and it's correspondending department here:

EquipmentIdDepartment
123456abcHosting
98765xyzCommunication
87234234kjHelpDesk
9876234bsHosting
27342asdfHelpDesk

 

I need to create a slicer and filter for reporting on cost per department.  Your help is greatly appreciated.

  • Go to 'Transform Data'

    Select the table with all of your data and then select 'Merge Queries'

    Select the mapping table and then select the 'EquipmentId' column for both tables...
    After clicking 'OK' you will have a new column added to your table that has a table in each row. 

    Expand that column. Select only the Department and deselect the 'Use original column name...'

    After clicking OK you should have the desired result in your table...

     

4 Replies

  • Have you considered merging the two tables together using the 'EquipmentId' column as the link and then expanding the resulting column to include only the 'Department"?

    • anaib's avatar
      anaib
      Frequent Visitor

      Hi jgeddes 

      Thank you for the pointer.  I will look up how to do that.  I am an infra guy 🙂

  • Go to 'Transform Data'

    Select the table with all of your data and then select 'Merge Queries'

    Select the mapping table and then select the 'EquipmentId' column for both tables...
    After clicking 'OK' you will have a new column added to your table that has a table in each row. 

    Expand that column. Select only the Department and deselect the 'Use original column name...'

    After clicking OK you should have the desired result in your table...