+ Reply to Thread
Results 1 to 15 of 15

Concatenate in PQ

  1. #1
    Registered User
    Join Date
    05-13-2023
    Location
    German
    MS-Off Ver
    Microsoft 365
    Posts
    27

    Concatenate in PQ

    Hello
    Dear forum, I need your help again.
    I have attached a file with the initial situation and desired result in PQ. Who could help me?
    Thank you in advance for your great help.
    greeting
    Ivan-
    Attached Files Attached Files

  2. #2
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: Concatenate in PQ

    Here is a solution with a formula (only the order is different): Please try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Concatenate in PQ

    U U.X K K.X 50 50.X 75 75.X
    Herbert x Name4 Katze Name01
    Ludwin Name9 Hund x Name09
    Caro Name21 Esel Name03 x
    Felix Name42 x Vogel Name07
    Sindra Dachs
    Group Name
    U Herbert
    K Name42
    50 Hund
    75 Name03
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-13-2023
    Location
    German
    MS-Off Ver
    Microsoft 365
    Posts
    27

    Re: Concatenate in PQ

    Hello
    @Sandy666
    First of all thanks for your SCNELLE answer.
    I also looked at your solution. Unfortunately I do something wrong.
    If I at Sindra an X in column andx so this name is not shown to me, what am I doing wrong?

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Concatenate in PQ

    try this one
    Attached Files Attached Files
    Last edited by sandy666; 06-30-2023 at 07:14 PM.

  6. #6
    Registered User
    Join Date
    05-13-2023
    Location
    German
    MS-Off Ver
    Microsoft 365
    Posts
    27

    Re: Concatenate in PQ

    Hello
    @ Sandy666
    Thank you very much for your help, now it will work out as desired.
    @Hansdouwe
    Thanks also for your solution, which unfortunately cannot use in this case, but is definitely used in another project.
    @All
    Just as a question?
    a) Is it possible to use columns to use columns variably ??
    b) How can you variable all columns format as text?

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Concatenate in PQ

    Quote Originally Posted by Ivan- View Post
    a) Is it possible to use columns to use columns variably ??
    explain by example

    Quote Originally Posted by Ivan- View Post
    b) How can you variable all columns format as text?
    1. select all columns
    2. Transform tab
    3. Data Type: Text

  8. #8
    Registered User
    Join Date
    05-13-2023
    Location
    German
    MS-Off Ver
    Microsoft 365
    Posts
    27

    Re: Concatenate in PQ

    Hello Sandy666
    Thanks again for the quick feedback.

    To my question B with text format:
    Yes, I had done that, these columns are formatted as text, now what I meant variably is if new columns should be added as text without making changes in the M code. Or is this not possible?

    To my question a chain with:
    Here, too, the columns should be variable when new columns are added without changing the M code.
    Example:
    U and U.X should become u as she did in the M code with the sign of equality.
    Now, for example, is added:
    K and K.X should become K without that I still have to mean the chain.
    Hope it is explained so understandable. Or is this not implementable?

  9. #9
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Concatenate in PQ

    if you want to combine columns, they must be text, especially with numeric data, because otherwise they will either format themselves to text (in a special case) or you will get an error
    Table.CombineColumns() is a text function and that's the whole explanation



    if the problem is solved, make me happy and hit Add Reputation (bottom left corner next to the post that was helpful) (if you did it - ignore this)

  10. #10
    Registered User
    Join Date
    05-13-2023
    Location
    German
    MS-Off Ver
    Microsoft 365
    Posts
    27

    Re: Concatenate in PQ

    Hello sandy666

    Thank you for your explanation.
    I can't explain it better, that's why I close the post.
    Thanks again for the quick help.

  11. #11
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Concatenate in PQ

    welcome





    if the problem is solved, make me happy and hit Add Reputation (bottom left corner next to the post that was helpful)

  12. #12
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Concatenate in PQ

    I deleted the last two steps from sandy's solution and then it does show the correct names when an X is placed or deleted
    Attached Files Attached Files

  13. #13
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Concatenate in PQ

    Quote Originally Posted by Roel Jongman View Post
    I deleted the last two steps from sandy's solution and then it does show the correct names when an X is placed or deleted
    I think you are wrong
    letters should be grouped (single values)

  14. #14
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Concatenate in PQ

    could be.. after reading the last few replies it seems that was about a second (b) question I missed.

    My interpretation to what the topicstarter wants is that beside U, K, 50 and 75 now being in the M code as he also wants new kolom sets added to be automaticly included in the list.
    so there can be more then 4 sets of 2 columns with relevant data that should be in the result list

    based on your solution that would mean (i think) that steps MC1 thru MC4 should be replaced by a custom function or other way that determines how many columns/data sets there are.

    I do not have the skill yet to build that but maybe this helps to get the topic going again.

  15. #15
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Concatenate in PQ

    @Roel Jongman
    I suggest to create your own solution not use from others then we can talk
    it was tailored to the example from post#1 and I don't have time to guess

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Vlookup and Concatenate or INDEX/MATCH and Concatenate
    By naumanxkhan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-03-2020, 09:44 PM
  2. Auto concatenate and reverse concatenate & Remove duplicates .
    By Andy308 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2016, 12:38 PM
  3. Concatenate with Double Info in Concatenate Cell
    By MRoz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-10-2015, 02:07 PM
  4. Replies: 5
    Last Post: 08-28-2014, 06:01 PM
  5. [SOLVED] VBA concatenate script does not excute as expected, Concatenate and "&" can't be dragged
    By VBAlex in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2014, 09:25 AM
  6. Replies: 2
    Last Post: 04-12-2010, 12:35 PM
  7. [SOLVED] [SOLVED] I know how to concatenate ,can one de-concatenate to split date?
    By QUICK BOOKS PROBLEM- in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-26-2005, 01:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1