Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody,
i'm here because I'm wondering whether there's any possibility to extract dynamically last three years from a table with for each...next loop instead that with a simple where.
Let us suppose we have a table with a measure column and a Year column.
Year column range goes from 2012 to 2023 and counting for next years.
Instead of loading table with "Where YearColumn >= Year(Now()))-3 i would like to get to that result through a loop.
Is there any chance?
Thank you
Attached here you will find an example of the table
the table you want to extract(your example), is this the only table or are the multiple tables with the same structure? if this is the case then a loop would be beneficial. otherwise the where statement will be faster.
so file 1.xlsx
Year, Measure
2012, 1000
... , ...
2023, 10
so file 2.xlsx
Year, Measure
2012, 15000
... , ...
2023, 1890
Yes, that's possible.
What issue do you see in using a where condition instead?
Hi @MartW
The table is part of a link table with differente structure among tables.
So, the for each statement should be applied only to this table.
Does it make sense applying the for loop ?
Hi @MarcoWedel
We were discussing with our collegues on which would be the faster and best solution between Where condition and for loop.
Do you have any advice?
Thank you