Sum of all reset instances

i m working on a dashboard which contains a energy value which gets reset on vehicle on off pattern in the same day multiple times. These are incremental values starts from zero and gets reset to zero again on vehicle off condition.Now i have applied sumOver(max({energy_consumption_without_regen}),[device_id]) which gives only the maximum value 28.4 for first device(vin) and 28.3 for the second device(vin). can any one suggest me here

@srinivasan_ab Thanks for reaching out. I entered your issue into our Community chat agent and this is what I got. I have asked @Brett to validate this when back online on Monday – but hopefully in the meantime this will help you get unblocked. :slight_smile:

To address the issue with energy values that reset on vehicle on/off patterns, you can use calculated fields to handle pre-aggregated data without additional aggregation. When working with table visuals where calculations have already been applied at the data level, you should place all fields in the “Value” field well without using the “Group by” field to avoid unwanted aggregation. 1

For your specific case with energy consumption values that reset to zero, you could try using conditional statements similar to these approaches:

  1. Create a calculated field that uses CASE or ifelse statements to handle the reset values, similar to how negative adjustments are handled in energy consumption metrics. 1

  2. You might consider using countOver with ifelse to identify specific conditions, which has proven effective for other users with similar aggregation challenges. 2

  3. Another approach is to use a formula like this to filter out unwanted values:

ifelse({energy_value}=0 OR other_conditions, NULL, {energy_value}) 

This would help remove noise or numbers affecting your calculation. 3

If you’re still getting only maximum values when you need to capture all reset periods, you might need to modify your approach to track each reset cycle separately, perhaps by creating a time-based partition in your calculation. 4

Hi @srinivasan_ab,

Following up here to see if you had any additional questions regarding your post or the solution provided; were you able to find a work around that successfully applied to your case?

Nope still i m looking out for the response

Hi @srinivasan_ab,

Could you clarify the issue and what you’re trying to complete here? For instance, are you saying that cycle id value should be 32.05 instead of 3.65, cycle id value should be 35.19 instead of 3.14, and so on?
If that’s the case, you may have to try building a formula that ranks your values based on cycle id, and then incorporate that into another calc. field that adds the cycle value to the 1st ranked value of the ranking or something along those lines.

Hi @srinivasan_ab,

Following up here as we have not heard back on this thread in a while; if you’re still working on this, please see my last comment about sharing some additional information.

If we do not hear back within the next 3 business days, I’ll close out this topic.

Thank you

Hi @srinivasan_ab,
Since we have not heard back further, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you