Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
krisslax
Contributor II
Contributor II

Loop Through Dates

Hello - I have a table with a list of Assets:

ObjectID ObjectType
AssetA1 Type1
AssetA2 Type2
AssetB1 Type3
AssetB2 Type3
AssetC1 Type1

 

And another table with a list of measurements:

ObjectID MeasurementDate MeasurementValue
AssetA1 02/01/2022 20
AssetB1 02/01/2022 45
AssetC1 03/01/2022 60
AssetA1 04/01/2022 26
AssetB1 26/12/2021 35
AssetC1 20/11/2021 45

 

What I want to do is create a new table with the date of 01/01/2022, which then loads each asset and adds the MAX measurement with a date less than 01/01/2022, then loops back subtracting a month from the date to go to 01/12/2021 and loads the MAX measurement again, until it hits 2018.

So essentially it's a history of the measurements taken, going back in time so I can track the measurements over a date range on a line chart.

Hope that makes sense.

 

Thanks in advance
-Kriss

Labels (1)
0 Replies