gorby
(RPA Ninja)
November 25, 2024, 12:29am
1
おはようございます
UiPath Studio 2022.4.3EnterPrise Editionユーザです。
下記2つの構文で同じ内容のdt_1が抽出できたため、少なくともデータの抽出をする際には、SelectとWhereは同じように使ってよいという認識ですが、合っていますでしょうか?
dt_1=dt_log3.AsEnumerable().Select(Function(c) c("Status").ToString() = "〇").GroupBy(Function(r) r("Date").ToString()).SelectMany(Function(g) g).CopyToDataTable()
dt_1=dt_log3.AsEnumerable().Where(Function(c) c("Status").ToString() = "〇").GroupBy(Function(r) r("Date").ToString()).SelectMany(Function(g) g).CopyToDataTable()
Yoichi
(Yoichi)
November 25, 2024, 12:45am
2
gorby:
下記2つの構文で同じ内容のdt_1が抽出できたため、少なくともデータの抽出をする際には、SelectとWhereは同じように使ってよいという認識ですが、合っていますでしょうか?
dt_1=dt_log3.AsEnumerable().Select(Function(c) c("Status").ToString() = "〇").GroupBy(Function(r) r("Date").ToString()).SelectMany(Function(g) g).CopyToDataTable()
dt_1=dt_log3.AsEnumerable().Where(Function(c) c("Status").ToString() = "〇").GroupBy(Function(r) r("Date").ToString()).SelectMany(Function(g) g).CopyToDataTable()
最初の式は静的エラーになると思いますので、結果が出力されることはないと思います。
ただしく何らかの出力を得られたのであれば、今一度式を確認された方が良いと思います。
Anil_G
(Anil Gorthi)
November 25, 2024, 4:46am
3
@gorby
Select is used to get a particular item from a given row
Where is used to filter the row based on a certain confition
Both are not same…
May be the select you are referring to might be the datatable select without AsEnumerable…then the functionality of where with AsEnumerable and select without asenumerable is same…
In current given syntax…the first suntax would fail as the select statement you have would pass true or false to the next where condition and as you are trying to use as row it would throw error
Cheers
gorby
(RPA Ninja)
November 25, 2024, 1:49pm
4
失礼しました。掲載する構文を間違えました。
下記2つの構文を実行したら、dt_1に同じ値が取得されたため、SelectとWhereのどこが違うんだろうと思った次第です。
dt_1=dt_log3.AsEnumerable.Select(Function(c) c("Status").ToString = "〇").CopyToDatatable
dt_1=dt_log3.AsEnumerable.Where(Function(c) c("Status").ToString = "〇").CopyToDatatable
gorby
(RPA Ninja)
November 25, 2024, 1:54pm
5
Sorry, but I referred unintended syntax.
Since I found the follwing two syntaxes resulted the same dt_1, I wanted to understand the difference of Select and Where.
dt_1=dt_log3.AsEnumerable.Select(Function(c) c("Status").ToString = "〇").CopyToDatatable
dt_1=dt_log3.AsEnumerable.Where(Function(c) c("Status").ToString = "〇").CopyToDatatable
Anil_G
(Anil Gorthi)
November 25, 2024, 2:01pm
6
@gorby
I believe you have not tried the syntax at all…as already mentioned select is different…select will get what you write inside it and where will filter
by default if you try with select you would get an error
cheers
Yoichi
(Yoichi)
November 25, 2024, 11:17pm
7
最初の式は静的エラーで実行できないはずです。何らかの値を取得できたのであれば、式が違うと思いますので、今一度確認ください。