Getting error of column not found. I want to calculate total sales per month and overall sales


Please provide the zip file is possible and any help would be appreciated. I am new to UiPath, so not able to grasp things quickly

Hi @22bec066

If possible can you please share sample input excel and expected output

Regards,


Expected output should be a a pop up message showing the total sales of each month and the overall sales. PFA, the input dataset, thankyou.

@22bec066

Can you try this

totalsales_Jan = dt.AsEnumerable().Sum(Function(x) CDbl(x("Jan"))).ToString()
totalsales_Feb = dt.AsEnumerable().Sum(Function(x) CDbl(x("Feb"))).ToString()
totalsales_Mar = dt.AsEnumerable().Sum(Function(x) CDbl(x("Mar"))).ToString()

Regards,

1 Like

@22bec066

overallsales = (CDbl(totalsales_Jan)+CDbl(totalsales_Feb)+CDbl(totalsales_Mar)).ToString

Regards,

1 Like

I’ll try it right away and let you know. Thankyou for the swift and quick response. Really appreciated

1 Like

Still facing the same error of Column : Jan not found.

@22bec066

No need to give the range..Just give Excel.Sheet(“Sheet1”)

Regards,

1 Like

Done, removed that and that error has resolved, but now it shows this

@22bec066

Can you show your workflow

@22bec066

No need to use For Each Excel Row activity..You can directly use Read Rang Workbook activity and Assign activities..

Please try this

Your final workflow should like below

Regards,

Assign: Value cannot be null. (Parameter ‘source’) , i copied your whole flow. Still getting this error. Does the dt. — part need to be changed ?

@22bec066

dt is the Output of Read Range Workbook activity

Regards,

1 Like

This has been resolved. But the error of Jan does not belong to the table is coming up again. Assign: Column ‘Jan’ does not belong to table DataTable.

@22bec066

Check if there is any space before or after column name i.e Jan and check sheetname

1 Like

I checked, everything is perfect.

@22bec066

Can you please share your xaml file

1 Like

Can you please share your number or email as here it says new users can’t upload files. So sorry for the inconvenience being caused