Forum Discussion
Anonymous
7 years agoNot applicable
Create table with repeating values based on start and end dates
I have a table with a number of records that have start a start-date and an end-date. From this I'd like to create a second table that has a separate record that repeats a certain value for each mon...
- 7 years ago
Anonymous
One way is to write a calculated table
From the Modelling Tab>>New Table
Calculated Table = VAR temp = GENERATE ( Table1, VAR no_of_month = DATEDIFF ( [Start], [End], MONTH ) + 1 RETURN SELECTCOLUMNS ( GENERATESERIES ( 1, no_of_month ), "MyValues", [Value] ) ) VAR temp2 = ADDCOLUMNS ( temp, "Month", EOMONTH ( [Start], [MyValues] - 1 ) ) RETURN SELECTCOLUMNS ( temp2, "ID", [ID], "Month", [Month], "Value", [Value] )
Anonymous
6 years agoNot applicable
Hi,
Is it possible to do something similar but basend on days not months?
anshulgrover7
2 years agoRegular Visitor
Hi Marcin211, Did you find any solution to this? I am trying to achieve the same but no luck.
What I need is
Date Hours in a Day Machine No.
1-1-2023 24 XX
1-2-2023 24 XX
1-3-2023 24 XX
1-1-2023 24 XY
1-2-2023 24 XY
and so on.
The machine numbers are finite,. Any suggestions how can I achieve this?