Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Add a team# on date/time table

I would like to know if anybody have done this before, or how youd do it :)

I have a normal date table who have a different day on each row.

I also have a Timetable who have a different minute on each roe and a dateID to connect the 2 date/time tables.

 

I would like to add a team# on the time/date relation.

There`s 4 teams A,B,C and D who work on a 7/7 Day and Night schedule.

 

If i know that team A start next wednesday (26-12-2018 for example) at Day and B at Night
AND C will start at Day and D at night on 02-01-2019.

 

I also have to say that day shift starts at 7am and end at 7pm and night shift start at 7pm and end at 7am.

 

How would you right the formula to scroll it down on my date/time table ?

 

 

Thank you very much.

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

     

    I'd like some sample to help us clarify your requirement. It is hard to code formula without any sample data.(table structure and relationship)

    How to Get Your Question Answered Quickly


    Regards,

    Xiaoxin Sheng

    • Anonymous's avatar
      Anonymous
      Not applicable

      This is my 2 tables : there is no relation between de two of them.

       

       

       

      [DateDimension][TimeDimension]

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous,

         

        I create two bridge table to link #team table with date and time.

         

        #Team table:

         

        Date Bridge =
        SELECTCOLUMNS (
            FILTER (
                CROSSJOIN ( '#Team', DateTable ),
                [Date] >= [StartDate]
                    && [Date] <= [EndDate]
            ),
            "Team", [Index],
            "Date", [Date]
        )
        
        
        Time Bridge = 
        SELECTCOLUMNS (
            FILTER (
                CROSSJOIN ( '#Team', TimeTable ),
                IF (
                    [StartTime] <= [EndTime],
                    [Time] >= [StartTime]
                        && [Time] <= [EndTime],
                    [Time] >= [StartTime] && [Time]<=TIME(0,0,0)
                        || [Time] <= [EndTime]&& [Time]>=TIME(0,0,0)
                )
            ),
            "Team", [Index],
            "Time", [Time]
        )
        

         

        Relationship:

         

        Visuals:

         

        Regards,

        Xiaoxin Sheng