Forum

Notifications
Clear all

TextJoin by ID

7 Posts
4 Users
0 Reactions
78 Views
(@dombrosygmail-com)
Posts: 11
Eminent Member
Topic starter
 

I am using Microsoft Office 365.

I have an exercise database. Exercises can be arranged in a sequence to create a recipe of exercises. Each recipe has a Recipe ID (which includes the sequence number for the exercises included in the recipe). 

I would like to Textjoin all the exercises for a particular Recipe but can't quite make it work. 

Ideally my Textjoin would produce something looking like this: 

Recipe Name (including the 1st 4 numerals from the recipe ID): 1st Exercise, 2nd Exercise, 3rd Exercise, 4th Exercise, 5th Exercise etc.

e.g. HipStrength 1000: 1st Exercise, 2nd Exercise, 3rd Exercise, 4th Exercise, 5th Exercise...

HipStrength 1000: 1st Exercise, 2nd Exercise, 3rd Exercise, 4th Exercise, 5th Exercise...

ShoulderStrength 1009: 1st Exercise, 2nd Exercise, 3rd Exercise, 4th Exercise, 5th Exercise, 6th Exercise, 7th Exercise...

Attached File

See attached file which includes the ideas on the right of the table about formulas that would help me to achieve this.

 

Your ideas would be appreciated.

 
Posted : 08/12/2023 7:46 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Dominic,

No file attached.

After selecting the file, click the Start Upload button and wait for it to upload fully.

Phil

 
Posted : 08/12/2023 9:01 pm
(@dombrosygmail-com)
Posts: 11
Eminent Member
Topic starter
 

Ok. Try now.

 
Posted : 08/12/2023 11:03 pm
Alan Sidman
(@alansidman)
Posts: 220
Member Moderator
 

See the attached whereby I split the first column in Power Query and then exported the query to the Data Model.  This then allowed the creation of two measures to concatenate the data in a pivot table.

 
Posted : 09/12/2023 12:43 am
(@dombrosygmail-com)
Posts: 11
Eminent Member
Topic starter
 

Thanks. That was interesting. That produced the ingredients in the recipe but also repeated the name of the recipe multiple times (which won't be useful unfortunately).

I was hoping for something simpler that would happen almost automatically.

 
Posted : 11/12/2023 4:25 pm
(@debaser)
Posts: 836
Member Moderator
 

You could use something like:

=LET(ID,LEFT(Table1[@[Recipe ID & Sequence]],4),IF(ID=LEFT(A1,4),"",Table1[@[Recipe Name]]&" "&ID&":"&TEXTJOIN(", ",1,IF(LEFT(Table1[Recipe ID & Sequence],4)=ID,Table1[Exercises],""))))

I'm not sure if you wanted exercises repeated in the result where they appear more than once in the table?

 
Posted : 12/12/2023 4:15 am
(@dombrosygmail-com)
Posts: 11
Eminent Member
Topic starter
 

Thanks so much. That is working really nicely.

 
Posted : 21/12/2023 2:56 pm
Share: