Unique values from data table


#1

Hi Team,

I have a input from excel (data table)in below format.

eid ename jobid age
1 rama 1234 12
2 seetha 2345 11
3 raja 1234 10
4 dev 2345 40
5 tej 6789 23

i want output like for each unique job id the eid values

THANKS


#2

Hi @rpadev,
you can use defaultview for fetch unique id

dt=dt.defaultview.totable(True,“ColumnName”)

Thanks,
P.Ajithkumar


#3

Thanks …and also with that unique id i want to get job id

please helpout here


#4

Hi @rpadev ,
Datatable.DefaultView.ToTable(True,“jobid”) save to datatable


#5

hi,

tried the same way but it didn’t worked our.

taken one assign activity


#6

Hi,
use one assign activity store the value as datatable. If u need workflow i will send tomorrow

Thanks


#7

@rpadev

Let us take you are having a datatable dta

Now Create one more datatable variable dtb

Use one assign Activity

dtb= (From p In dta.Select
        Group p by jobId=Convert.ToString(p("jobid") Into GroupA=Group
        Select GroupA(0)).ToArray.CopyToDataTable.DefaultView.ToTable(False,"eid","jobid")

Now dtb will Contain only distinct job ID and their eid values.

Regards,
Mahesh