I have one workbook with multiple sheets named with date and year. Starts with the current month and current year, and it goes back to January of the year. For example, it is June 2019 now, so the workbook contains the following sheets in this order:
Each sheet contains lots of sales data. Now, I need to search for a certain sales data row from all these sheets. Initially, I thought about searching the data only from the current month, and if not found, go back to the previous month sheet, and then if still not found, go back to the previous month, until it is found, or not found at all. Like retrieve DataTable from each sheet using Read Range activity, each time the data is not found in a specific month.Let’s call it Method A.
(The reason I thought about doing this at first, was because the data we search tend to be found in closer months to the current month. For example, the data we search NOW can only be found in June 2019 sheet, and if not, it is more likely to be found in May 2019 sheet, rather than January 2019 for example as it is too far in the past.)
However, I realized it might be easier if I just keep reading all data from each sheet, and append all data back to back, creating one big DataTable. Let’s call it Method B. This way, I don’t have to worry about “having to go back to the previous month if the data is not found”. Like, I would only need one search within one DataTable, whereas Method A would require multiple searches if the data is not found in a certain month.
My questions are:
In situation like mine, do you think Method B is an easier and better idea? I just thought the logic would be much simpler and there would be less activities with Method B. Do you think this is a good idea? I am very new to UiPath and I want your opinion.
How can I read from each sheet until it hits January of the year, appending each DataTable underneath it each time? Like
[ Block of June 2019 data]
[ Block of May 2019 data]
[ Block of April 2019 data]
and so on, into one big datatable. I thought about using Append Range activity, but this looks like it will write into an actual excel file, which I don’t need. I only need to use DataTable consisting of all months’ data. Can anyone give me some advice?