Forum Discussion

ameyazing's avatar
ameyazing
New Member
7 years ago

Individual record for each date in range

Hi,

I have TABLE1 which has entries made by users as follows:

 

NAME        RECTYPE        STARTDATE        ENDDATE        UTILIZATION

EMP1         Leave             20-Jun                 21-Jun             100

EMP1         Task_RFx       17-Jun                 30-Jun               50

EMP1         Task_Int         17-Jun                 18-Jun              50

EMP2         Task_RFx        1-Jun                   15-Aug            100

EMP2         Leave              24-Jun                 28-Jun             100

EMP3         Task_Int          10-Jun                21-Jun              100

 

I want to break-up the range of each record into individual rows only for next 30 days, excluding weekends, in TABLE2 as:

NAME        RECTYPE         DATE          UTILIZATION

EMP1         Task                17-Jun        100 (#Adds up utilization of all tasks)

EMP1         Task                18-Jun        100

EMP1         Task                19-Jun        50   (#Task_Int has ended, so only 50% utilized)

EMP1         Leave              20-Jun        100   (#Leave overrides all tasks)

EMP1         Leave              21-Jun        100

EMP1         Task                24-Jun        50 (#weekend skipped; next record is for Monday)

.... Similarly for all employees

 

I tried a lot, but unable to get anywhere close to how I can create this kind of table. Any help would be highly appreciated. Thanks.

1 Reply

  • DouweMeer's avatar
    DouweMeer
    Impactful Individual

    ameyazing 

     

    Easiest way would be by creating a date table and a measure. Then add a single select visual for 'NAME'. If this is your intented output.

    Otherwise, use something similar inside a calculated column to extract your data. You don't really need an intermediate table similar to that. Just create it on the fly per name and your done.