11 Replies Latest reply: Jun 1, 2016 4:55 PM by Stefan Wühl RSS

    Display curve with condition

    Jean-Christophe GUILLERMIN

      Hello,

      I have a table like this one

      RefWork OrderWork CenterDateTotal TimeVariation
      A1WO12015/451025

      B

      2

      WO1

      2015/45514
      A3WO22015/46155
      D4WO32015/472-4
      C5WO12015/4545
      B6WO22015/495-15
      A7WO12015/451025

       

      This table gives for each Work Center for each date the total time produced on this work center and the variation compared to the last 4 weeks.

      I would like to display on a graph only the evolution of the production time of the work center where variation is >10 (if we are 2015/46, i want to see the evolution during the year of production of the work center where variation is >10).

      How should i perform this?

        • Re: Display curve with condition
          Stefan Wühl

          Could you detail how you the context of your chart should look like?

           

          As far as I understood, you have Date as dimension, and you have a single Work Center selected.

           

          A work center may show several Work Order per Date, so you need to aggregte the records. I guess you want to sum() the records? And filter each record by Variation > 10?

           

          Try a dimension Date, select a Work Center and use as expression in your chart

          =Sum({<Variation = {">10"}>} [Total Time])

            • Re: Display curve with condition
              Jean-Christophe GUILLERMIN

              Hi,

              Thanks for your help.

              A work center will show several work order per date.

              Aggregation per week & per work center is already done during the loading process, no need to sum. Total Time is really what the work center has produced during the week displayed in [date] field. In my table, the first & last row is Work Center WO1 for 2015/45, total time is the same value as WO1 produced 10h during week 45 in 2015).

               

              I do not have any work center selected. I want the system to show the work center(s) where variation is >10 for the previous week (today, we are 2016/22, so I want to see the system to display [Total Time] evolution for all work centers where variation >10 at 2016/21).

               

              Is it clear?

                • Re: Display curve with condition
                  Stefan Wühl

                  I still haven't fully understood how your chart should work:

                   

                  In the first two lines,you show the same work, same date, but different total time. Hence I think if you want to show in the chart e.g. a line per work center and across the dates, you would need to aggregate to take care of the multiple records (multiple work order).

                   

                  Besides this, I think I would start with creating a sequential field that counts the weeks in chronological order in your script / master calendar, if you've created your calendar with the dates sorted, it could look like

                   

                  =LOAD

                       Date,

                       Autonumber(Date) as DateNum,

                       ...

                   

                  Then I would create a line chart and use Date as dimension and probably [Work Center] as second dimension, which should put Date on the axis and draw a line per Work Center.

                   

                  as Expression, maybe

                   

                  =Avg(

                  {<[Work Center] = {"=Avg({<DateNum = {$(=Max(DateNum)-1)}>} Variation) >10"}>}

                  [Total Time])

                   

                  Again, I needed to use an aggregation function because there are multiple work order lines per combination of Work center and date. If you want to filter on work order instead, replace work center with work order in above expression.

                   

                  Use Aggregation Functions!