Forum Discussion

nicolast29's avatar
nicolast29
Helper V
3 years ago

One sheet for each unique value in first column

hi, I am still a new be to arrive alone for this case, that i am sur is possible with a function

 

I have a file that i want to automatically separate on a sheet base on the unique value in the first column (Number of the company)

 

Can someone help me to do it

Exemple in source file

 

And what i want after (the number of the comany is in the sheet

 

https://1drv.ms/x/s!AoqtZHsX4BzvhJpf2VOxtt_75NgaHw?e=LjeFBj

 

Thanks

Nicolas (du 29 in France)

5 Replies

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi nicolast29 

     

    To my knowledge, Power Query is not a good tool to complete this task. In Power Query, queries cannot be created automatically or dynamically according to a dynamic value from another query. The queries are pre-defined by you, so the number of queries cannot be changed according to the data change in a single query. However, the number of companies in your original table may change I guess. 

     

    I found some articles about using Python or Power Automate to complete this task. I believe using other tools to split the sheet is better. Hope they will be helpful:

    How To Split An Excel File Into Multiple Files Using Python - Python In Office

    Solved: Split an Excel file into several sheets - Power Platform Community (microsoft.com)

    How to Export filtered data to Excel from Power BI... - Power Platform Community (microsoft.com)

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

  • MAwwad's avatar
    MAwwad
    Solution Sage

    Salut,

     

     

    Can you better explain the topic ? I would be more than happy to help you 🙂 

    • nicolast29's avatar
      nicolast29
      Helper V

      Yes no pb

      My irginal file arrive with one sheet, and i need to split it in x sheet with one sheet for each unique value in the column, the company name

       

      In the original file i have all row for all company in the only sheet

      And i want to extract the row for the company A in the sheet A (A is an example)

      The row for the company B in the B sheet etc

       

      Is it better explain ?

      Nicolas

       

       

      • MAwwad's avatar
        MAwwad
        Solution Sage

        Exactly, I dont think that Power Query does this job also as it doesnt workwith Spread sheets.

         

        Using a VBA code or Python you can split them

  • MAwwad's avatar
    MAwwad
    Solution Sage

    How many sheets are you looking to split ? How many numero de site ?