# Datatable doubt

**URL:** <https://forum.uipath.com/t/datatable-doubt/446520>\
**Category:** Studio\
**Tags:** workflow-diff, question, studio, excel, system, activities\
**Created:** [June 8, 2022, 10:40am UTC](https://forum.uipath.com/t/datatable-doubt/446520 "2022-06-08T10:40:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![alan\_prakash](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alan_prakash/32/264391_2.png) [@alan\_prakash](https://forum.uipath.com/u/alan_prakash)\
**Post date:** [June 8, 2022, 10:40am UTC](https://forum.uipath.com/t/datatable-doubt/446520/1 "2022-06-08T10:40:34Z")

</div>

[FilteredData.xlsx](https://forum.uipath.com/uploads/short-url/2D8fgtWEWlGe0pbCfIHt6Z325XW.xlsx) (7.5 KB)  
This is my data table i want to extract the smallest and largest price from this excel for that i have used filtereddt.AsEnumerable().Min(Function(row) Cint(row(“Price”))) this linq function but shows the error "Assign: Conversion from string “” to type ‘Integer’ is not valid."Pls help to resolve this solution

---

<div class="post-metadata">

**Author:** ![Lak\_Ui](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lak_ui/32/180042_2.png) [@Lak\_Ui](https://forum.uipath.com/u/Lak_Ui)\
**Post date:** [June 8, 2022, 10:41am UTC](https://forum.uipath.com/t/datatable-doubt/446520/2 "2022-06-08T10:41:30Z")

</div>

Can you share some sample value values for price in the excel?

---

<div class="post-metadata">

**Author:** ![alan\_prakash](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alan_prakash/32/264391_2.png) [@alan\_prakash](https://forum.uipath.com/u/alan_prakash)\
**Post date:** [June 8, 2022, 10:43am UTC](https://forum.uipath.com/t/datatable-doubt/446520/3 "2022-06-08T10:43:52Z")

</div>

what sample value

---

<div class="post-metadata">

**Author:** ![Lak\_Ui](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lak_ui/32/180042_2.png) [@Lak\_Ui](https://forum.uipath.com/u/Lak_Ui)\
**Post date:** [June 8, 2022, 10:45am UTC](https://forum.uipath.com/t/datatable-doubt/446520/4 "2022-06-08T10:45:26Z")

</div>

so you basically have an excel file price as a column right? what are the values contained in price coumn.or if you could share the input excel it would be great

---

<div class="post-metadata">

**Author:** ![alan\_prakash](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alan_prakash/32/264391_2.png) [@alan\_prakash](https://forum.uipath.com/u/alan_prakash)\
**Post date:** [June 8, 2022, 10:48am UTC](https://forum.uipath.com/t/datatable-doubt/446520/5 "2022-06-08T10:48:04Z")

</div>

[MergedData.xlsx](https://forum.uipath.com/uploads/short-url/bCbX7TG5mFWOYSzaoZInprfkdKR.xlsx) (9.7 KB)  
the above excel i have shared is the filtered one this is the main excel i want to extract the minimum and maximum from the filtered excel that i have mentoned above

---

<div class="post-metadata">

**Author:** ![Lak\_Ui](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lak_ui/32/180042_2.png) [@Lak\_Ui](https://forum.uipath.com/u/Lak_Ui)\
**Post date:** [June 8, 2022, 10:55am UTC](https://forum.uipath.com/t/datatable-doubt/446520/6 "2022-06-08T10:55:08Z")

</div>

Please remove , and $ from price ie. row(“Price”).Replace(“,”,“”).Replace(“$”,“”)

---

<div class="post-metadata">

**Author:** ![alan\_prakash](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alan_prakash/32/264391_2.png) [@alan\_prakash](https://forum.uipath.com/u/alan_prakash)\
**Post date:** [June 8, 2022, 10:58am UTC](https://forum.uipath.com/t/datatable-doubt/446520/7 "2022-06-08T10:58:57Z")

</div>

In the entire excel how can i remove that symbol

---

<div class="post-metadata">

**Author:** ![Lak\_Ui](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lak_ui/32/180042_2.png) [@Lak\_Ui](https://forum.uipath.com/u/Lak_Ui)\
**Post date:** [June 8, 2022, 11:00am UTC](https://forum.uipath.com/t/datatable-doubt/446520/8 "2022-06-08T11:00:51Z")

</div>

in that linq query itself you can use it filtereddt.AsEnumerable().Min(Function(row) Cint(row(“Price”).toString.Replace(“,”,“”).Replace(“$”,“”)))

---

<div class="post-metadata">

**Author:** ![alan\_prakash](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alan_prakash/32/264391_2.png) [@alan\_prakash](https://forum.uipath.com/u/alan_prakash)\
**Post date:** [June 8, 2022, 11:05am UTC](https://forum.uipath.com/t/datatable-doubt/446520/9 "2022-06-08T11:05:40Z")

</div>

it is still showing the same error

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [June 8, 2022, 11:16am UTC](https://forum.uipath.com/t/datatable-doubt/446520/10 "2022-06-08T11:16:53Z")

</div>

> [@alan\_prakash](#):
>
> Conversion from string “” to type ‘Integer’ i

we cannot convert empy values / blank but can filter out

give a try at:

```auto
(From d in filtereddt.AsEnumerable()
Where Not (isNothing(d("Price")) OrElse String.IsNullOrEmpty(d("Price").toString.Trim))
Select x= Cint(row("Price").toString.Trim)).Min(Function (x) x)

```

Also we can decide for other strategies like:

- using the Int32.TryParse() method
- ordering the values and taking first / last for min and max

---

<div class="post-metadata">

**Author:** ![alan\_prakash](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alan_prakash/32/264391_2.png) [@alan\_prakash](https://forum.uipath.com/u/alan_prakash)\
**Post date:** [June 8, 2022, 11:21am UTC](https://forum.uipath.com/t/datatable-doubt/446520/11 "2022-06-08T11:21:22Z")

</div>

How can i assign this,can u elaborate

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [June 8, 2022, 11:23am UTC](https://forum.uipath.com/t/datatable-doubt/446520/12 "2022-06-08T11:23:55Z")

</div>

Assign Activity  
LHS: myMin | DataType: int32  
RHS:

```auto
(From d in filtereddt.AsEnumerable()
Where Not (isNothing(d("Price")) OrElse String.IsNullOrEmpty(d("Price").toString.Trim))
Select x= Cint(row("Price").toString.Trim)).Min(Function (x) x)

```

---

<div class="post-metadata">

**Author:** ![alan\_prakash](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alan_prakash/32/264391_2.png) [@alan\_prakash](https://forum.uipath.com/u/alan_prakash)\
**Post date:** [June 8, 2022, 11:25am UTC](https://forum.uipath.com/t/datatable-doubt/446520/13 "2022-06-08T11:25:40Z")

</div>

what is d i am not good at [vb.net](http://vb.net) thats why i ask

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [June 8, 2022, 11:27am UTC](https://forum.uipath.com/t/datatable-doubt/446520/14 "2022-06-08T11:27:24Z")

</div>

it is like a local variable referencing the looped datarow within the LINQ

> [@\[HowTo\] LINQ (VB.Net) Learning Catalogue](https://forum.uipath.com/t/howto-linq-vb-net-learning-catalogue/325671):
>
> This topic references the different Learning HowTos related to LINQ. It will be updated on new published HowTos as well LINQ Learning: Topic LINK First Start with LINQ [[HowTo] - First Start with LINQ (VB.Net)](https://forum.uipath.com/t/howto-first-start-with-linq-vb-net/318964/) Exploring the LINQ universe [[HowTo] - Exploring the LINQ Universe (VB.Net)](https://forum.uipath.com/t/howto-exploring-the-linq-universe-vb-net/325667)Operator [HowTo] Overview Topic LINK Where [[HowTo] LINQ - First Start # Where Operator](https://forum.uipath.com/t/howto-linq-first-start-where-operator/464108) Select work in progress Any [[HowTo] LINQ – First Start # Any Operator](https://forum.uipath.com/t/howto-linq-first-start-any-operator/466138) All [[HowTo] LINQ – First Start…](https://forum.uipath.com/t/howto-linq-first-start-all-operator/467292)

---

<div class="post-metadata">

**Author:** ![alan\_prakash](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alan_prakash/32/264391_2.png) [@alan\_prakash](https://forum.uipath.com/u/alan_prakash)\
**Post date:** [June 8, 2022, 1:48pm UTC](https://forum.uipath.com/t/datatable-doubt/446520/15 "2022-06-08T13:48:32Z")

</div>

it looks fine when i remove the null values but i have to filter that price and write it into new excel sheet i filter using filter datatable but shows no values how it can be rectified

---

<div class="post-metadata">

**Author:** ![Lak\_Ui](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lak_ui/32/180042_2.png) [@Lak\_Ui](https://forum.uipath.com/u/Lak_Ui)\
**Post date:** [June 8, 2022, 1:49pm UTC](https://forum.uipath.com/t/datatable-doubt/446520/16 "2022-06-08T13:49:49Z")

</div>

Can you show the filter condition?

---

<div class="post-metadata">

**Author:** ![alan\_prakash](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alan_prakash/32/264391_2.png) [@alan\_prakash](https://forum.uipath.com/u/alan_prakash)\
**Post date:** [June 8, 2022, 1:52pm UTC](https://forum.uipath.com/t/datatable-doubt/446520/17 "2022-06-08T13:52:27Z")

</div>

![Screenshot (53)](https://global.discourse-cdn.com/uipath/original/4X/e/2/8/e28037d4be726633ffec53301ca317e0a030d1e8.png)  
by extracting the smallest price it shows 16999 instead of 16,999 i think that the problem

---

<div class="post-metadata">

**Author:** ![alan\_prakash](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alan_prakash/32/264391_2.png) [@alan\_prakash](https://forum.uipath.com/u/alan_prakash)\
**Post date:** [June 8, 2022, 2:00pm UTC](https://forum.uipath.com/t/datatable-doubt/446520/18 "2022-06-08T14:00:01Z")

</div>

do u got it

---

<div class="post-metadata">

**Author:** ![Lak\_Ui](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lak_ui/32/180042_2.png) [@Lak\_Ui](https://forum.uipath.com/u/Lak_Ui)\
**Post date:** [June 8, 2022, 2:00pm UTC](https://forum.uipath.com/t/datatable-doubt/446520/19 "2022-06-08T14:00:37Z")

</div>

Try  
Convert.ToDecimal(cheapest).ToString(“#,##0”) to convert it to original format and then do the filter operation. I think you need to add $ as well in the beginning

---

<div class="post-metadata">

**Author:** ![alan\_prakash](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alan_prakash/32/264391_2.png) [@alan\_prakash](https://forum.uipath.com/u/alan_prakash)\
**Post date:** [June 8, 2022, 2:01pm UTC](https://forum.uipath.com/t/datatable-doubt/446520/20 "2022-06-08T14:01:39Z")

</div>

in the filterdata table?

[Next page](https://forum.uipath.com/t/datatable-doubt/446520.md?page=2)
