Calculo de datos / Campo calculado

Hello, good afternoon, I’ll comment a little on the situation. Solved that a line gives me data from an unplanned stop that lasts 2 hours but the QS divides it every 10 minutes as seen in the screenshot I uploaded. Our data source sends me data every 10 minutes, my question is the following:
Could a calculated field be made so that this “UnPlanned Stop” is shown only once and that it is 1 data of 7200 seconds, and not that it shows me 12 data of 600 seconds?

Hello @agustinmoncada94, I believe I know how you would manage this. Rather than directly using the StartTime, EndTime, and last time category, you can utilize LAC-W functions to get a single value for each distinct Equipo field.

This will require 3 functions. I will show you how to get the minOver value for StartTime, maxOver value for EndTime, then we can sumOver the final time all partitioned by Equipo.

minStartTime = minOver({StartTime}, [{Equipo}], PRE_AGG)

maxEndTime = maxOver({StartTime}, [{Equipo}], PRE_AGG)

TotalTime = sumOver({TimeCategory}, [{Equipo}], PRE_AGG)

Utilizing those fields should give you the solution you are looking for! Let me know if you have any questions.

Hello, thank you for responding, I have a question, what are you referring to when you say
TotalTime = sumOver({TimeCategory}, [{Team}], PRE_AGG)

I don’t know what to put in “TimeCategory”

Would it look more or less like this?


or so with each one?

Hello @agustinmoncada94, when I am referring to your TimeCategory field, I mean the last column in the image you posted above. ParadaNoPlanificado EquipmentTimeCategory.

Also, you will need to enter each function into their own calculated field. They will act as the new columns for your visual. The minStartTime = portion of the function I posted won’t actually be in the calculated field, that is just what you can name it.

I tried it there and it’s not what I’m looking for. What I want to be left with is like this…

what I have:

And what I want to achieve is this (manual table for example now)

What does this mean; I have the same table as the previous one, but now I am not having the 600 second limitation. Stops, for example, at point 3,6,7 exceed 600 seconds (10 minutes) and bring me the data. That’s what I want to achieve.

The problem I am having is that, when a state lasts more than 10 minutes = 600 seconds, it cuts it off and continues on another line as I show in the first image. I want to achieve that if the state lasts 15 minutes = 900 seconds, I show the 900 seconds in a single line.

The function that you gave me looked like this:

Hello @agustinmoncada94, is your Equipo field always the same value? If so, how are you determining when a new start occurs? The calculation I sent you will give you the total time based on the partition of Equipo, so if that value does not change or does not determine a single session, then it will just total everything. Whatever you are using to determine each state should be what you replace the Equipo field with in the calculation above.

My field “Unplanned Stop EquipmentTimeCategory” brings me the duration of an “unplanned stop” that is, if the machine was not running for 35 seconds, it will bring me those 35 seconds. That is, it brings me the duration of the machine’s state “Unplanned Stop”

1 Like

Hello @agustinmoncada94, does “Unplanned Stop” determine the end of the session? And if so, is that always what determines the end? As long as there is a field that returns a value that we can use to split the total time into partitions, we can use it to get the total time each session was active. If there is some kind of ID, name, etc. field that is specific to each session, you can use that in place of Equipo in the partition field of the function.

Hello @agustinmoncada94, please follow up with some more information related to the questions I asked in my last response. The function I provided above should return your expected solution if you have a field that determines when each session ends. The partition is based on a column in your dataset, and it will return a total time value depending on a group. If you have some kind of ID that determines an individual session, that would be ideal. If we do not hear back from you in 3 days, I will archive this topic. Thank you!