How to get the inbetween values like 10-20

HI,

image

I want filter the Station values in the DT

By using the Data Scrape Get the Column and Store as “DT”

And the Station values stores in “GetStation”>> AS a String

I using the Select method But I don’t know get the inbetween value while “-” appears
{if 14-19 means the values are 14,15,16,17,18,19} Like that

Can u plzz gave suggestion for this I Want to Get the DTFilter and Stored in the Ouput Activity

@Rajiduraikannu_Santhosh_G

You mean want to fetch the rows whose station value is in between 10-20 ?

Hi @lakshman ,

yes bro if in the Station 10-20
I want the Value DT Column Name “Station” Values between 10 to 20

Have you tried using, simple range something like this a >= 10 && a <= 20

Try pairing the above range in Linq Statement something like this:

(From d In dt.Select() Where Cint(d(“Station”))>=(20) And CInt(d(“Station”))<=(30) Select d).CopyToDataTable

Hi @ManiPrajwal_K ,

the 10-20 Values are the dynamic and also in the Station Tab we enter some time one value like “130” or “130,201” or “130,1350-140”

Like that bro how can i set the range in this?

image

This is my workflow

In this Assign Activity I tired for (ie.10,12) like Value in the GetStation for that Split the Values
But its gave a Error message as {“No Rows Occurs”}

Lets assume following:

  • A string, seperating the values by comma
  • listing ranges by using a hyphen
  • 1350-140 will not occur as ranges will list at first the lowest and second the max of a range

So we can create list of min max pairs by following:
grafik
YourString.Split(","c).Select(Function (x) {x.Split("-"c).First(),x.Split("-"c).Last()}).toList

In case of this would work for you then we can help you to set up a LINQ implementing the filtering

We would recommend the aprroach from above instead of creating a list with all range items, as this list can be also long for wide spanning ranges. For demo purpose have a look here:

grafik
strRangeList = String.Join(",", RangeList)
grafik

Find starter help here:
RangeString_To_RangeItemList.xaml (4.9 KB)

1 Like

Hi @ppr ,

Thanks a lot for ur brief explanation :star_struck:

I Try this its Working , I got the expected Values :star_struck: :+1:t4:

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