5 Replies Latest reply on Aug 13, 2018 10:59 PM by Rajesh Kota

    How do i set custom time range for parameters

    Rajesh Kota

      Hello All,

       

      Please help me to sort out the below issue.

       

      I have a Start Date & End Date Parameters, Date_Time filter, Shift, Manufacturing Time in my view.

       

      So based on the start date and end date parameters, i have used relevant filters to get relevant shift & relevant time.

       

      I am getting correct values for 1st shift (6AM to 2PM)and 2nd shift(2PM to 10PM) respectively.

       

      But for the 3rd Shift (10PM to next day morning 6AM), values are not coming correctly.

       

      Here the data is coming for 12AM to 6AM (this comes under previous day third shift data) & 10PM to 11:59PM (Today's third shift data) since the parameter by default timing is 12AM

       

       

      So, the requirement is when you click on 3rd shift, the Date_Time filter should show 10PM to next day morning 6AM data. i.e 10:00:00PM to 6:00:00AM

       

      Can i change parameter default time to 6AM so that i can show the correct third shift data like below. (For this i manually fixed 6:00:00AM timing.If you change the date, again it will go back to 12:00:00AM)

       

       

      Or is there any workaround available for the above requirement? I have attached TWBX workbook.

       

      Any help would be appreciated.

       

      Thanks in advance.

        • 1. Re: How do i set custom time range for parameters
          Ritesh Bisht

          Hi Rajesh,

           

          Do you mind keeping Start time as default 12 AM and End time as default 6 AM ?

           

           

          Screen Shot 2018-08-12 at 8.46.45 PM.png

           

          By doing that we can avoid

           

          Screen Shot 2018-08-12 at 8.38.06 PM.png

           

           

          Screen Shot 2018-08-12 at 8.38.06 PM.png

           

           

          Screen Shot 2018-08-12 at 8.44.44 PM.png

           

           

          Please find the attached file.

           

          Please mark the answer as CORRECT/HELPFUL if it really helped you so that it can help others as wll

           

          Thanks,

          Ritesh

          • 2. Re: How do i set custom time range for parameters
            Rajesh Kota

            Hello Ritesh,

             

            Thanks for your answer.

             

            But that is not the correct workaround i am looking for.

             

            When you put start time as default 12AM & if you click on third shift, the data is not coming from 10PM.

            • 3. Re: How do i set custom time range for parameters
              Don Wise

              Hi Rajesh,

              Please see if the attached solution is workable...I did notice that your shifts are hard-coded, which actually helps with defining the time periods automatically.  However, please notice in the 3rd screenshot that their are data associated with "Third_Shift" which are not within your defined parameters for that particular shift.  There are data that fall within the middle of the day.  So, I think if the data can be corrected, the attached might be a workable solution.  Instead of creating a different date filter on top of another existing date filter (which competes with each other), I overlaid a timeline and made it a dual-axis chart. That way your machine names are still at the bottom of the chart, you still have your bar chart with the sum of manufacturing time, but above the bars will display the time period involved for that particular shift.  Hopefully this answers your need.  If so, please mark this response as correct.  Thx, Don

               

              1st Shift:

              1st Shift.png

              2nd Shift:

              2nd Shift.png

              3rd Shift:

              Screen Shot 2018-08-12 at 1.12.03 PM.png

              • 4. Re: How do i set custom time range for parameters
                Okechukwu Ossai

                Hi Rajesh,

                 

                I guess this is what you are looking for

                 

                My assumption is that you will always put the start and end time as default 12AM. If yes, I've created a second parameter [Select Shift] and also modified [Calculation1] field. See attached workbook.

                 

                Step 1: Create parameter [Select Shift]

                 

                Step 2: Create calculated field [Row Filter]

                IF [Select Shift] = [Shift] AND [Select Shift] = 'First_Shift'

                AND [Date_Time] >= [Start Date] AND [Date_Time] <= [End Date] THEN 1

                 

                ELSEIF [Select Shift] = [Shift] AND [Select Shift] = 'Second_Shift'

                AND [Date_Time] >= [Start Date] AND [Date_Time] <= [End Date] THEN 1

                 

                ELSEIF [Select Shift] = [Shift] AND [Select Shift] = 'Third_Shift'

                AND [Date_Time] >= DATEADD('hour', 22, DATETRUNC('day', [Start Date]))

                AND [Date_Time] <= [End Date] THEN 1

                 

                ELSE 0

                END

                 

                Add [Row Filter] to the filter shelf and set to 1.

                 

                Hope this helps.

                Ossai

                • 5. Re: How do i set custom time range for parameters
                  Rajesh Kota

                  Hello Ossai,

                   

                  Thanks for the answer.

                   

                  I have implemented the above workaround previously. Here if we select "Third shift" using the parameter you have created based on the [Row filter] calculation, the time is coming from 10PM to 11:59PM. (i.e we are getting 2 hours only)

                   

                  But i need next 6 hours also so that i can see the complete third shift from 10PM to next day morning 6AM.

                   

                  That is the reason i want to set custom time range parameter default time as 6:00:00.

                   

                  Best Regards,

                  Rajesh