cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
fionaweston
Level III

working backwards from an event

In my mini table (attached) I have 6 units. Each unit can have a particular event called "Voltage Drop".

I would like to add a column to my table that counts back from this event to any and all previous events that happened since the prior Voltage drop event for that unit and gives me the duration  from this event to the Voltage Drop event.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: working backwards from an event

This should work. Data has to be sorted and this will most likely have some errors if it cannot find Voltage Drop in the end of datatable (should be easy fix by checking if Loc(mdrops > row() is empty or if min() is missing)

With this formula you can get closest voltage related to row number:

If(:C Code Desc != "Voltage Drop",
	m_drops = Loc(:C Code Desc << get as matrix, "Voltage Drop");
	closest = m_drops[Min(Loc(m_drops > Row()))];
)

Then you can use that row number to get time of voltage drop with

:STARTTIME[:COLUMNRESULT]

with those two you should be able to calculate time differences in new formula (you can also combine all into one formula)

 

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: working backwards from an event

This should work. Data has to be sorted and this will most likely have some errors if it cannot find Voltage Drop in the end of datatable (should be easy fix by checking if Loc(mdrops > row() is empty or if min() is missing)

With this formula you can get closest voltage related to row number:

If(:C Code Desc != "Voltage Drop",
	m_drops = Loc(:C Code Desc << get as matrix, "Voltage Drop");
	closest = m_drops[Min(Loc(m_drops > Row()))];
)

Then you can use that row number to get time of voltage drop with

:STARTTIME[:COLUMNRESULT]

with those two you should be able to calculate time differences in new formula (you can also combine all into one formula)

 

-Jarmo