Forum Discussion
nickvanmaele
3 years agoAdvocate II
Add a variable number of columns automatically, based on parameters
Hi, My question is how I can add a variable number of date columns to an existing table in an automatic way. Context I am trying to create a large fact table filled with test data by using on...
- 3 years ago
This is easier to do directly in an unpivoted format (you can pivot afterward if you feel like it).
Add a custom column that is a list of dates from pStartDate to pEndDate.
List.Dates(pStartDate, Duration.Days(pEndDate - pStartDate)+1, #duration(1,0,0,0))Then expand this list column.
nickvanmaele
3 years agoAdvocate II
Hi AlexisOlson
Thank you so much for that elegant solution. Better than the strategy that I was following.
Note: for some strange reason, the "Accept this as solution" button is not visible on your reply. It was visible, but when I pressed it, my own post got marked as the solution, instead of your reply. Some bug, no doubt. You certainly deserve your reply to be marked as solution. I will see if I can still get the site to do this.