Forum Discussion

mitchpj75's avatar
mitchpj75
Helper I
3 years ago

Concatenation??

Hi all, 

 

Just looking for some advice.  Below is my table (screenshot for context)

This is the data format setout for ease of reading

 

case_idcase_row_idDate of CallCall successful?Date of Call column TO BE CREATEDCall successful column TO BE CREATED
330001/11/2018No01/11/2018;02/11/2018No;Yes
330102/11/2018YesThis row would then be deletedThis row would then be deleted
332001/11/2018Yes01/11/2018Yes
333001/11/2018No01/11/2018;02/11/2018;06/11/2018No;No;No
333102/11/2018NoThis row would then be deletedThis row would then be deleted
333206/11/2018NoThis row would then be deletedThis row would then be deleted
336002/11/2018Noetc 
336108/11/2018No  
336214/11/2018Yes  
339001/11/2018No  
339102/11/2018Yes  
340001/11/2018No  
340102/11/2018No  

 

Whenever there is a unique case id, I need:

 - Date of call values to be merged into a new Date of Call Column

- Call Successful values to be merged into a new Call successful column

 

Is it best to concatenate?  if so how??

 

Thanks 🙂

 

1 Reply

  • Hi, mitchpj75 

    let
        raw_data = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjY2UNJRAmNDfUNDfSMDQwsgxy9fKVYHJmsIkjVCko1MLYZKG2HTjJA2xmu2MTazUWTBxpthkzWDmYxVrxnMZAtcsiCTDU2wOtoSr6Mt8QaICd7QNMEamiDZWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [case_id = _t, case_row_id = _t, #"Date of Call" = _t, #"Call successful?" = _t]),
        Source = Table.TransformColumnTypes(raw_data, {{"Date of Call", type date}}, "en-GB"),
        z = 
            Table.Group(
                Source, {"case_id"}, 
                { {"Date of Call", each Text.Combine(List.Transform([Date of Call], Date.ToText), ";")}, 
                {"Call successful", each Text.Combine([#"Call successful?"], ";")}}
            )
    in
        z