Forum Discussion

DanJohansen's avatar
DanJohansen
New Member
4 years ago
Solved

Create new rows based on From and To values in two columns

Hi, I have a table which looks like this:

Nr.KontoartFrom AccountTo Account
100Managementfee1011010113
110Lejeindtægter1012110124
120Øvrige indtægter1121011212

 

and I would like it to end with this result:

Nr.KontoartAccount
100Managementfee 10110
100Managementfee 10111
100Managementfee 10112
100Managementfee 10113
110Lejeindtægter10121
111Lejeindtægter10122
112Lejeindtægter10123
113Lejeindtægter10124
120Øvrige indtægter11210
121Øvrige indtægter11211
122Øvrige indtægter11212

 

any Ideas for that will be appreciated very much! 

  • Hi DanJohansen ,

     

    Assuming your From/To columns are in numerical format, you can add a custom column like this:

     

    = {[From Account]..[To Account]}

     

    You can then expand the nested list column to new rows.

     

    If your original columns aren't numerical, then you'll need to wrap the column references in Number.From:

     

    = {Number.From([From Account])..Number.From([To Account])}

     

     

    Pete

4 Replies

  • Hi DanJohansen ,

     

    Assuming your From/To columns are in numerical format, you can add a custom column like this:

     

    = {[From Account]..[To Account]}

     

    You can then expand the nested list column to new rows.

     

    If your original columns aren't numerical, then you'll need to wrap the column references in Number.From:

     

    = {Number.From([From Account])..Number.From([To Account])}

     

     

    Pete

    • DanJohansen's avatar
      DanJohansen
      New Member

      Hi Pete! Thx for answering and yes, the two columns are numerical, but I get this error:

       

      • BA_Pete's avatar
        BA_Pete
        Super User

        Hi DanJohansen ,

         

        Apologies, I updated my answer with the curly braces that are needed right after I posted, but you'll need to refresh your browser (F5) to see (basically, put curly braces around the whole thing).

         

        My bad.

         

        Pete

  • Thx Pete! You are a life saver! Whereever you are, have a nice day! 😄