How to extract count

I have done up a workflow to do a count to ‘Tabulation’ for the number of people who have participated in a survey based on the department in ‘Staff List’
Sequence1.xaml (11.0 KB) Tabulation.xlsx (11.6 KB) Staff List.xlsx (21.0 KB)

However, how should I change the workflow so that the count would also appear in the next column for 30th March and 31st March with the header as the date coming from the sheet name in ‘Staff List’?

Hi @foppishinc !
Here is a suggestion to do so: Sequence1.xaml (20.3 KB)
Before running it in your computer, don’t forget:

  • to change the path of Staff List.xlsx (twice in the code)
  • to remove all data in the C column in the file Tabulation

To understand the code:

  • I noticed that the headers you want in the file Tabulations are the names of the worksheets in the file Staff List, so what I did first is getting all the sheet names in Staff List, then loop in it
  • Instead of writing each cell (so to open and write the file 6 times), I suggest to open it once to write it at the end of the workflow
  • I recylced the variable output2 into output_to_be_written, this datatable is a copy of stafflist datatable (so 2 columns), and in each loop a column is added, and its name is the name of the sheet

Let us know if the result is not what is expected, or if I missed something :grin:


How do I add a column of Percentage beside the column that has the count like this?

Hi @foppishinc
Here is the way. Sequence1.xaml (22.2 KB)
The same logic is used: add a datacolumn, then do a calculus to fill it
Beware: you can’t have several times “Percentage” as a header name

Hey @Hiba_B , I have a missing or invalid activity when I downloaded the workflow!

Hi @Hiba_B I think my sequence was not uploaded properly, here is my sequence with no missing activity.Sequence.xaml (11.2 KB)

Hi @foppishinc !
When you see “Missing activites”, that means that you need to update the following packages at least:

Hi @Hiba_B , I am unable to update to 21.4.0 version as I am on the UiPath Studio trial version, the update installation is causing errors for me

Could you help me screenshot the workflow so I can figure it out on my 20.4 version?

Ok, tell me what are the missing elements:

@Hiba_B mine looks like this, I am missing the ‘Filter Data Table’ activity that you have in the sequence

Ok indeed filter activity has evolved (only by the design), then instead of the missing activity you can drag and drop filter datatable activity and fill it this way:

Let us know if something is wrong !

@Hiba_B I got errors for these

What are your variables and the formula for the percentage?

The formula for the percentage is in the assign percentage (on the right you can see the formula).
Also, dt_output__to_be_written in a the variable as you can see below, that is initialized right under the first read range

@Hiba_B I am still having the same errorsSequence1 (1).xaml (15.3 KB)

@foppishinc here is the WF updated to 2020.4, let me know if there are still missing activities ! Sequence1.xaml (17.8 KB)

@Hiba_B The count is wrong though, this is the results I got from running it

but the count should be like this

Sure, I have forgotten the IndexVar (to put it in the loop of foreach), here is the corrected one: Sequence1.xaml (17.9 KB)

hi @Hiba_B sorry, the sequence you uploaded was for 21.4 as there are missing activities, where did you put the IndexVar?

Really sorry for the inconvenience… I did not expect that much oftroubles on versions :sweat:
IndexVar is put in the loop of foreach (as an output index):

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.