Hi Experts,
Hope you all are well.
I need your help on below use case.
I have input as
Required Output -
For Coumn B result, i want to divide column B by 100
For column D result, i want to append hyphen in Column C value
Please suggest Linq Query only.
Test.xlsx (8.9 KB)
Thanks.
ppr
(Peter Preuss)
July 29, 2021, 3:12pm
2
have a look on the expression property of a datacolumn
Maybe a more straighforward way instead of LINQ
After adding the computed columns you can
take needed cols with dt.DefaultView(…
rename the cols
@PeruT
it can be achieved while configuring the custom datascraping:
start Datascrapping Wizard
indicate first cell
click no for
configure first column (indicating firdt and second cell)
click on extract correlated data
indicate first cell Company column
configure:
[grafik]
click on extract correlated data
click on first link, second link, configure:
[grafik]
get:
[grafik]
and so on
Kindly note to enhance the retrieved link withe base url info:
retrieved: market-activity/ipos/o…
But this is related to scrapping, i just want calculation on the same column.
ppr
(Peter Preuss)
July 29, 2021, 3:17pm
4
not related to scraping it is done on a datatable.You also asking for a datatable, right?
yeah that’s correct , i have downloaded that xaml but i don’t find anything useful.
I just need a single Linq, if you have please share it.
ppr
(Peter Preuss)
July 29, 2021, 3:23pm
6
then you was very fast to RnD
Add Datacol - Amount 2
set Expression - “Amount / 2”
check result
LINQ is not allways the prefered choice, Rough Prototype
dtTarget = dtData.Clone
(From d in dtData.AsEnumerable
let a = (ConvertToDouble(d(Amount))/ 100).toString(“F2”)
let r = d(“Reason”).toString & " - "
Let ra = new Object(){d(0), a, d(2), r}
Select dtTarget.Rows.Add(ra)).CopyToDataTable
1 Like
I have already achieved this through adding new columns and have it’s expression and then putting back to same column.
I am looking for something where i can get directly calculated values from single linq.
Not sure if this can be possible.
ppr
(Peter Preuss)
July 29, 2021, 3:28pm
8
refer post above for rough linq suggestion
1 Like
Thanks, i will try to execute this.
system
(system)
Closed
August 1, 2021, 3:32pm
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.