Getting Excel column 1 value based on Highest value in Excel Column 2

Hello,
I have one scenario, in which I am scrapping data from NSE Live website. The data scrapping is done from table from website and storing in excel value. I want to get text value of column1 corresponding to highest value of column 2 of excel using Uipath.
For example the highest value of column 2 is -: 12345.56, So I want to get text value from column 1 which is Symbol name corresponding to that column 2 value which is LTP column

Please anyone help me out with this issue on urgent basis.

I am attaching screenshot and scrapped excel file.
Sorry I cannot share the code with anyone due to privacy issue.

NSE_Data_06012021_0343.xlsx (8.3 KB)

PFA
Regards
Rohit Lanjewar

1 Like

Hey @rohit.lanjewar,

Here is a workaround for you to fetch high LTP stock from the list.

PFA - NSE_TopGainer.zip (9.8 KB)

Hope this helps.

Thanks :slight_smile:

Thanks NithinKrishna for very prompt response and solution you provided. I will try your solution that you provided and will let you know whether it works or not for my issue.

Regards
Rohit Lanjewar

1 Like

Hello NithinKrishna,
The solution is working fine that you have suggested for me. Just wanted to know, whether the solution for different columns like %Change, Volume Value for getting Symbol name from excel similarly as well. Also just small request to you. Can you please the workflow to me what is done to get symbol name for highest LTP column value in your workflow.

Regards
Rohit Lanjewar

1 Like

Hey @rohit.lanjewar,

You can follow the same approach with small tweaks or even add few things in the same condition to get the higher one using other params.

So, now coming the approach of the solution below

  1. Read the excel nse data in a DT

  2. Select and retrieve the LTP column from the DT in decimal format of list

  3. Sort the list

  4. Find the row which has the last element of the sorted list (highest).

  5. The name column of the row is the stock name.

Hope this helps.

Thanks :slight_smile:

1 Like

Thanks NitinKrishna for suggestion. I will try this solution in my workflow for getting column name for another column of excel as well.

Thanks for explanation of approach of the solution that you have provided.

Regards
Rohit Lanjewar

1 Like

Hello NithinKrishna,
I have another issue which is related to Build DataTable and adding data to existing datatable using Add DataRow activity. I have used Build DataTable, in which 3 columns are present which are Top Live Analysis Values, Top Symbol Name, Top Symbol Value. In which I have added the Top Live Analysis Value in Build DataTable. But my requirement for the process is that I want to add Top Symbol name and Top Symbol value in Second and 3rd column in the datatable. I tried to use Add DataRow activity to add Symbol name value in Existing datatable using Build dataTable. But I am getting Symbol name for highest LTP Value below in the same column in Top Live Analysis Value Column.
For example the DataTable should be →
Top Live Analysis Value | Top Symbol Name | Top Symbol Value
Top LTP | Maruti | 8003.29
Top % Change | Maruti | 1234.56
Like wise for other values in DataTable. It means Symbol Name and Symbol Value should be displayed infront of TopLTPValue using Uipath.
Please help me out with solution of this issue. I am attaching screenshot for your reference.

Build_DataTable_NSE_Data_Scrapping_Screenshot

Top_SymbolName_Added_To_Top_Analysis_Values_Column_Screenshot

PFA
Regards
Rohit Lanjewar