Hello Gliders! I have an array column of numbers, for example: 5, 10, 12
Today I want to extract the first one, “5”
Tomorrow the second one, “10”
Day after tomorrow, “12”
Thenafter, repeat the cycle again, extracting 5, then 10, then 12, etc, etc.
I guess I could run a schedule workflow every day, but how do I extract?
Thanks!
So you have a fixed “start date” for your cycle? Can you explain more about the use case?
It can be done through a single value > from start > dynamic index.
Yes, I have a fixed start day (today, through timestamp).
I see you have varying lengths of the array there. Do they reset on the same day (so same cycle) or not?
Yes, there can be varying lengths. If the array is “3, 5, 2” for example, then I should be able to extract the values like this:
Day1: 3
Day 2: 5
Day 3: 2
Day 4: 3
Day 5: 5
Day 6: 2
Day 7: 3
Day 8: 5
and so on, repeating the cycle.
Will different rows have different starting days?
Will the array length change at any point?
Yes, different rows have different starting days. Each row is independent, having a unique array and unique starting date. For each row, the array length and data does not change.
Ok here’s my proposed solution.
From the array, use this to get the array length.
Use this to calculate the date difference between the start date and now: TRUNC(N-D)
Use this to calculate the index of the “current day”: MAX(MOD(D,C),0)
And finally this to get the number of the day via the index.
Wonderful !!!
Thanks a lot Thinh!!!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.