How to count only enter values except empty values of excel sheet

Suppose we have index size 1-25 in excel sheet …but only 5 records are filled rest are empty ,so we want to have values of only those 5 records which are filled in the excel sheet…

@bhala

Try below select query.

                 newDT = inputDT.Select("[Column 1] <> '' AND [Column 2] <> '' .....").CopyToDataTable

Where inputDT is your input data.

please elaborate

Hi
If possible can I have a screenshot of this
Even a sample one is fine

Cheers @bhala

@bhala

Do you want to read the data from excel file other than empty rows right ?

yes…

@bhala

  1. First use Read Range activity to read the data from exel file and will give you output as DataTable and say ‘inputDT’.

  2. And then use above mentioned select query to read only enter data except null values. Here, You have to specify columns based on how many columns your excel file has.

The above mentioned expression will fetch all records whose column values are not Null.

Blockquote

And then use above mentioned select query to read only enter data except null values. Here, You have to specify columns based on how many columns columns your file has

Blockquote

.

where to put this query…

@bhala
You can simply remove empty records by using Filter Data Table activity.

Kindly refer the below image for reference FilterDT

Now in new Data Table you have only non empty rows. Now, you can use assign activity to get rows count.
Count = YourDTName.Rows.Count return you number of rows in your data table.

1 Like

if we want to do it in loop how can we do it

@bhala
After filtering the Data table we get new Data table without empty rows. So, by using for each row activity you can iterate new data table.

sir we are not getting please explain it with an example with an excel sheet … we are new in this fiels so we dont know much…please help us

@bhala
Please find the attachment for reference.DataTable.xaml (8.2 KB) laptop.xlsx (10.0 KB)
Hope it helps.


coloumn name name is not set or invalid error ocuured