Regarding excel value

I have a excel and in M column i have a value eg: 15,467.20 and have to compare the value wth sap ,so in sap the value is matching but issue is : excel value is appearing 12,1467.2
Hence i am stuck.

Please help

Hi @Myra_varma

You mean the value in excel that you see and what bot is getting is not same?

Cheers

Hi @Myra_varma ,

If you want the bot to maintain two decimal places, then use the following operation:

image

CDbl(NumberVariableGoesHere).ToString("N2")

Kind Regards,
Ashwin A.K

Yes.
Excel M column value : 15,234.20
In sap value : 15,234.20
But when bot run , it says value doesn’t match.

When i checked excel file manually i found that even i see 15,234.20 but when i click that column in above bar where we see the value it is showing 15,234.2

Please share the screen shot of this complete code snippet.
It will be helpful

Hi @Myra_varma

Check out the XAML file

ExcelValueUpdate.xaml (9.5 KB)

Regards
Gokul

Hi @Myra_varma

While comparing numbers you can always convert them to number and compare. Cdbl(variable) will convert the number string to a type double/number. That way even if trailing 0 is missing the validation will still pass

Cdbl(exceldatavariable.trim).equals(cdbl(sapdatavariable.trim)

Cheers

So in assign activity what is the data type for using that cdbl function and also i have to read j column but we dont know the ending point of j column.
My approch : dtbal.rows.indexof(row)
But not getting the ans please help me

Hi @Myra_varma

The datatype for cdbl is System.double.

Can you give me more details about the question on J Column are you trying to read whole of column J from Excel then the Range can be J:J, if thats not the question can you be more clear

cheers

Sure
Problem statement : In my excel i have so many values but the main value Currency eur alway comes in j column. My task is get the value of j column and compare it to sap.
J column - header Currency eur - 12,345.20
Sap value - 12,345.20

1st issue was missing 0 in excel and 2nd issue how to read the j column as last column varies

Hi @Myra_varma

If the column name is same then use read range with add headers check box ticked then even if the currency column changes you can get the values using the name of the column

And if you do not have 0 then you can check if the value is numeric or not by Isnumeric(Variable) which gives true when the variable has number else false

Or if you want the last row then dt.rowcount-1 will give the index of last row in the given datatable

cheers

Thank you anil for supporting can you provide me the xmal pls

Hi @Myra_varma

Without the exact input I cannot…If you can give me the input I can provide

or If you share screenshots I can help you if you are going wrong anywhere

cheers

Hi @Myra_varma ,

We would need to know how the Comparison is happening between the two values. If an expression is used, Could you provide it’s Screenshot or the expression itself ?

For Reading the J Column, Let us know if a Column Header is being used, For Example - If the Column header is mentioned as EUR, We could use it as reference to access that column value.

But we would need more details of what you have implemented in order to completely analyse your situation.