Jiban_Stars
(Jiban Kumar Das)
January 31, 2022, 1:56pm
1
Hello people, how are you all
Im stuck at a excel scenario,
So my scenario is as—
Lets say there array of strings with values= A,B,C,D,E,F
& we have a excel file (check the photo to understand)
So Dyanmically any alphabet value is getting pulled
& for that aplhabet
we need extract/retrive its value from “Details” column ( check the photo)
as well as the just following row value of that particular Column
example if D is selected
then we need to get its respected “Details column” value & just below “details” column value as well
Please help
ppr
(Peter Preuss)
January 31, 2022, 2:03pm
2
we can do as following:
read in excel into a datatable
remove with wilter datatble all empty rows (e.g. all Details Column)
fill up the Name row as it was done here:
FillUp_BlockBlanks.xaml (8.7 KB)
Later you can just filter on the letter and will get the corresponding details
Jiban_Stars
(Jiban Kumar Das)
January 31, 2022, 2:13pm
3
Umm Man, i think you didnt get my question
accordingto your example
Lets “B” is selected,
then we should be getting output like
1st “4” then another output should be “5”
ppr
(Peter Preuss)
January 31, 2022, 2:18pm
4
on begin the sample data looks like:
B1 = A, B2 = B mapping to your case
After filling up it is looking like this:
so when filtering e.g. for B2 we get the two rows B2-4, B2-5
it looks similar to your case, right?
Jiban_Stars
(Jiban Kumar Das)
January 31, 2022, 2:29pm
5
Thanks for the reply
But sorry my case is bit different
1st= Im not supposed to edit the original excel file
2nd = example when “D” is picked
it’s respected “Details” column & then the below “details” column value should be coming
I need a proper expression for it
as im using a type into activity to writer those 2 sperate values…in different places
Hopefully now you got my question
ppr
(Peter Preuss)
January 31, 2022, 2:36pm
6
we do it temporary on datatable and do not change the excel
after filling up we can filter e.g. on A, B, C… and will get the corresponding rows only
we can use the filter result and process it
to stay on the sample data, after filling up and filtering on a particular value we get
However as there are also altrnate implementations possible, maybe you will prefer another approach as well
1 Like
Jiban_Stars
(Jiban Kumar Das)
January 31, 2022, 2:48pm
7
Thanks
May I know any alternative approaches please ??
Without using filter datatable
ppr
(Peter Preuss)
January 31, 2022, 3:15pm
8
grouping data can help after filling up
as described here
This HowTo introduces on the different options for grouping data from a datatable in order to process the grouped data.
Introduction
Grouping data and processing the grouped data is a common scenario e.g. when the grouped data is to aggregate like summing up, find maximum, get the average or concatening items.
Lets have a look on following data:
[grafik]
A possible scenario could be:
Create a report containing following information:
the region code
the sum of CaseCount per RegionCode
t…
or a dictionary approach like this
done with:
(From d In dtData.AsEnumerable
Group d By k=d(0).toString Into grp=Group
Let v=grp.Select(Function (x) x(1).toString).toArray
Select t=Tuple.Create(k,v)).ToDictionary(Function (t) t.Item1, Function (t) t.Item2)