Filterr

@Yurdanur_Yusuf

DT.AsEnumerable.OrderBy(Function(x)Cdbl(x(1).ToString)).First.ItemArray //Row having Minimum Value
DT.AsEnumerable.OrderBy(Function(x)Cdbl(x(1).ToString)).Last.ItemArray //Row having Maximum value

@Yurdanur_Yusuf

Please share the error that you are getting in the Add Queue Item Activity.

Thanks

how can i apply

hi @Yurdanur_Yusuf , do you need to go through all the rows of the data table or just pick the cheapest and most expensive in the data table and then add it to the queue?

@Yurdanur_Yusuf


yellow mark is your column number

yellow mark is datatype of variable

1 Like

I need to pick the most expensive and least expensive from the data table and add it to the queue.

@Yurdanur_Yusuf Column Started from 0 and I think you have 2 column only


I said 2 for column number

@Yurdanur_Yusuf do you need to check if there are rows with the same price? (for example, 3 items have the same price as the most expensive)

1 Like

no they are all different

image
how do i add the first and last row in the data

@Yurdanur_Yusuf Now problem is that your data contains “,” commas and “TL”
Its means you have data in string not Integer or Double.
We can’t get Max value from string

how can i get the first row from data

you can actually remove the If condition.

What I did is I sort it first in ascending order to get the cheapest then I add the queue item. after that, I sorted it into descending order to get the most expensive then I add the next queue item.

Here’s my code:
SortDataTable.xaml (9.2 KB)

1599
529
499
599
When prices are like this, they can’t sort correctly.
because it does it according to the first digits

Hi @Yurdanur_Yusuf,

In this case, we will remove the Sort Data table.

First, I updated the data table by replacing the “.” with “” and “,” with “.” and remove the “TL” word. We need to do this so that it can be sorted properly.

Here’s the variables for Minimum and Maximum

The we get the Minimum Value first

after that we get the Max Value

Here’s the updated code
SortDataTable.xaml (14.7 KB)

1 Like

For the “product code” and “features” columns, add them as arguments on the Collection properties of the “Add Queue Item” activity.

The Details.AsEnumerable() is to get the Minimum and Maximum “fiyat” values by virtually sorting the data table on the backend.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.