Forum Discussion

Dan_Machen's avatar
Dan_Machen
Frequent Visitor
8 years ago
Solved

Sequentially concatenating row values

Hi, I have a table that looks like this

 

ACCOUNTAttemptCH_ATTEMPT_STATUS
000000011S
000000012N
000000021S
000000022N
000000023N
000000031F
000000032F
000000033S
000000041N
000000042S

 

For each Account, I want to sequentially concatenate the row values in the 'CH_ATTEMPT_STATUS' column by ascending values from the 'Attempt' column. So going by the above example, the resulting column would look like this..

 

ACCOUNTAttemptCH_ATTEMPT_STATUSCH_Pat
000000011SS
000000012NSN
000000021SS
000000022NSN
000000023NSNN
000000031FF
000000032FFF
000000033SFFS
000000041NN
000000042SNS

 

 

I don't even know where to start, how would I do this?

 

Thanks,

 

Dan

  • Dan_Machen

     

    Hi, try with this calculated column

     

    CH-PAT = CONCATENATEX(FILTER(Table1,Table1[ACCOUNT]=EARLIER(Table1[ACCOUNT]) && Table1[Attempt]<=EARLIER(Table1[Attempt])),Table1[CH_ATTEMPT_STATUS],,Table1[Attempt],ASC)

    Regards

     

    Victor

    Lima - Peru

  • Dan_Machen

     

    This Calculated Column will also get you the desired RESULTS :smileywink:

     

    Column =
    CONCATENATEX (
        TOPN (
            TableName[Attempt],
            FILTER ( TableName, TableName[ACCOUNT] = EARLIER ( TableName[ACCOUNT] ) )
        ),
        TableName[CH_ATTEMPT_STATUS],,
        TableName[Attempt]
    )

     

     

3 Replies

  • Vvelarde's avatar
    Vvelarde
    Community Champion

    Dan_Machen

     

    Hi, try with this calculated column

     

    CH-PAT = CONCATENATEX(FILTER(Table1,Table1[ACCOUNT]=EARLIER(Table1[ACCOUNT]) && Table1[Attempt]<=EARLIER(Table1[Attempt])),Table1[CH_ATTEMPT_STATUS],,Table1[Attempt],ASC)

    Regards

     

    Victor

    Lima - Peru

    • Zubair_Muhammad's avatar
      Zubair_Muhammad
      Community Champion

      Dan_Machen

       

      This Calculated Column will also get you the desired RESULTS :smileywink:

       

      Column =
      CONCATENATEX (
          TOPN (
              TableName[Attempt],
              FILTER ( TableName, TableName[ACCOUNT] = EARLIER ( TableName[ACCOUNT] ) )
          ),
          TableName[CH_ATTEMPT_STATUS],,
          TableName[Attempt]
      )