Results 1 to 1 of 1

Thread: PQ - Cleanup data with several conditions

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sir Moderator sandy666's Avatar
    Join Date
    May 2018
    Posts
    239
    Rep Power
    7

    Cool PQ - Cleanup data with several conditions

    Source data Expected item no.
    Carrier Name Item No. Finalised Clean Data
    CMA Atlantis / 150965
    150965
    CMA 150965 / Atlantis
    150965
    CMA Atlantis - 150965
    150965
    CMA
    150965
    150965
    CMA Oceania - 100258
    100258
    CMA Ocean - 100258
    100258
    CMA
    100258
    100258
    CMA OCN100258
    100258
    CMA Oceania /100258
    100258
    EGTL Eagle - DBSH261296 DBSH261296
    EGTL DBSH261296 DBSH261296
    EGTL DBSH261296 / EGTL DBSH261296
    EGTL Eag DBSH261296 DBSH261296
    EGTL Tainer DBSH261296 DBSH261296
    EGTL Greenland DBSH280399 DBSH280399
    EGTL DBSH280399 DBSH280399
    EGTL Green - DBSH280399 DBSH280399
    EGTL GL / DBSH280399 DBSH280399


    • Operator inputs different variants of data which makes data collection messy
    • Clean data represents what should have been input for the Item No. highlighted in yellow
    • There is a total of 18 variants, the data should be clean like expected item no. column
    • The original data that I need to use will be over hundreds of variations so manually doing this will not be possible
    • Is there a way for me to see how many variants does CMA and EGTL have each?
    • I will also create a chart to monitor on a weekly basis to see if the number of variants has gone up or down


    Result
    Carrier Name Res Count
    CMA 150965
    4
    CMA 100258
    5
    EGTL DBSH261296
    5
    EGTL DBSH280399
    4


    cleanupchart.png

    Code:
    // Table1
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        Text = Table.TransformColumnTypes(Source,{{"Item No.", type text}}),
        IF = Table.AddColumn(Text, "Res", each if [Carrier Name] = "CMA" then Text.Combine(List.RemoveItems(Text.ToList([#"Item No."]),{"a".."z", "A".."Z", "/", "-", " "})) else if [Carrier Name] = "EGTL" then Text.Combine(List.RemoveItems(Text.ToList([#"Item No."]),{"a".."z", "A","C","E".."G","I".."R","T".."Z", "/", "-", " "})) else null),
        Grp = Table.Group(IF, {"Carrier Name", "Res"}, {{"Count", each Table.RowCount(_), type number}})
    in
        Grp
    Last edited by sandy666; 07-13-2023 at 04:02 AM.
    sandy
    I know you know but I forgot my Crystal Ball and don't know what you know also I may not remember what I did weeks, months or years ago so answer asap. Thinking doesn't hurt

Similar Threads

  1. Drop-Down Menu with Multiple Conditions
    By Anshu in forum Excel Help
    Replies: 11
    Last Post: 09-04-2020, 05:07 PM
  2. Replies: 1
    Last Post: 07-27-2020, 12:09 AM
  3. Excel Nested IF Function With 3 Conditions
    By patsir in forum Excel Help
    Replies: 3
    Last Post: 08-25-2012, 07:15 PM
  4. split data into multiple workbooks with 3 conditions.
    By malaionfun in forum Excel Help
    Replies: 5
    Last Post: 05-11-2012, 11:26 AM
  5. obtain data from 3 input with conditions
    By mtsf26 in forum Excel Help
    Replies: 13
    Last Post: 11-11-2011, 08:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •