how to get first three max value column name in second row in data table …don’t show again again column name… (ex 3-7 row only)
| name | col 1 | col 2 | col 3 | col 4 | col 5 | col 6 | col 7 |
|---|---|---|---|---|---|---|---|
| 1-3 | 2 | 0 | 16 | 4 | 38 | 0 | 37 |
| 3-7 | 3 | 5 | 100 | 7 | |||
| Total | 2 | 0 | 21 | 4 | 0 | 47 | 37 |
how to get first three max value column name in second row in data table …don’t show again again column name… (ex 3-7 row only)
| name | col 1 | col 2 | col 3 | col 4 | col 5 | col 6 | col 7 |
|---|---|---|---|---|---|---|---|
| 1-3 | 2 | 0 | 16 | 4 | 38 | 0 | 37 |
| 3-7 | 3 | 5 | 100 | 7 | |||
| Total | 2 | 0 | 21 | 4 | 0 | 47 | 37 |
Quick Prototype for getting the 3 values
we recommend to enhance / adapt it like empty value, non int value handling
But:
can also be understood different and we would like to ask for expected sample output. Thanks
i want only column name
still a sample output would help as asked by us
Maybe you are looking for this:
Assign Activity:
arrNames | String Array =
(From t In dtData.Rows(1).ItemArray.Select(Function (x,i) Tuple.Create(i,x)).Skip(1)
Let x = t.item2
Let x1 = If(isNothing(x) OrElse String.IsNullOrEmpty(x.ToString), int32.MinValue.ToString, x.ToString)
Let xp = If(int32.TryParse(x1, Nothing), Int32.Parse(x1), int32.MinValue)
Order By xp Descending
Select cn = dtData.Columns(t.item1).ColumnName).Take(3).ToArray
share sequence file for reference
