Get data from a table - dynamic data


#1

HI All,
I have a set of a data in a table, (Attached the screen shot). In this table i would like to get the data of ‘amount’ column where state=‘CA’. This dataset is dynamic, some days there are 3 rows with stat=‘CA’ and other days it may be 5. Please suggest some ideas to get this data from the table.


#2

Hi @yuvaraja,

First extract the data to datatable using extract Structure data.(dt)
After getting the hole table just apply the filter condition.
Dt=Dt.select("state='CA'").CopyToDataTable()

Regards,
Arivu


#3

@yuvaraja
If you want only Amount then use the below query , it will give you the lamount which satisfies the condition as a list of strings.

Let us take your datatable as dt
ListA=(From p in dt.Select
where Convert.ToString(p.Item(“state”)).Equals(“CA”)
Select Convert.ToString(p.Item(“amount”))).ToList

Regards,
Mahesh


#4

Thanks @arivu96 @MAHESH1 but I am unable to extract the data set correctly whatever selector combination is used. This is where I am trying to extract, https://alloyui.com/examples/datatable/real-world