# How to report the column name from column scores

**URL:** <https://forum.knime.com/t/how-to-report-the-column-name-from-column-scores/6633>\
**Category:** KNIME Analytics Platform\
**Created:** [September 10, 2014, 7:00pm UTC](https://forum.knime.com/t/how-to-report-the-column-name-from-column-scores/6633 "2014-09-10T19:00:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![richards99](https://forum-cdn.knime.com/user_avatar/forum.knime.com/richards99/32/48547_2.png) [@richards99](https://forum.knime.com/u/richards99)\
**Post date:** [September 10, 2014, 7:00pm UTC](https://forum.knime.com/t/how-to-report-the-column-name-from-column-scores/6633/1 "2014-09-10T19:00:12Z")

</div>

Hi,

I have an interesting problem I am not able to fathom out how to do it. To give some background first, the full table is likely to be about 20 columns and 200000 rows. The data input could change such that the number of rows may change but the column structure stays unchanged.&nbsp;

So the problem is, I have many IDs which are assessed by various categories A, B, C etc and scored against these categories from 0 to 1. I then want to report back the lowest score observed, and which category(s) gave the lowest score. Now I know how to report back the lowest score observed using column aggregator node on Cols A-Z and chose Minimum as aggregation method, but am unsure how to get another column reporting back the column name(s) which gave the lowest score in an efficient way. So an example is:

ID. &nbsp;ColA. &nbsp;ColB. &nbsp;ColC. &nbsp;ColD. &nbsp;ColE

1. &nbsp; &nbsp; &nbsp; 0.1. &nbsp; &nbsp; 0.5. &nbsp; &nbsp; 0.7. &nbsp; &nbsp; &nbsp;0.2. &nbsp; &nbsp; 0.3

2. &nbsp; &nbsp; &nbsp; 0.9. &nbsp; &nbsp; 0.8. &nbsp; &nbsp; 0.4. &nbsp;&nbsp; &nbsp; 0.4.&nbsp; &nbsp; &nbsp;0.5

3. &nbsp; &nbsp; &nbsp;0.6. &nbsp; &nbsp; &nbsp; 0.5. &nbsp; &nbsp; 0.3. &nbsp; &nbsp; &nbsp;0.8. &nbsp; &nbsp;1.0

should return these extra columns

ID. &nbsp; &nbsp; MinScore. &nbsp; &nbsp; &nbsp;MinCategory

1. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.1. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A

2. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.4. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; C, D

3. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.3. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; C.

&nbsp;

ideas anyone.

simon.

---

<div class="post-metadata">

**Author:** ![aborg](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@aborg](https://forum.knime.com/u/aborg)\
**Post date:** [September 10, 2014, 8:45pm UTC](https://forum.knime.com/t/how-to-report-the-column-name-from-column-scores/6633/2 "2014-09-10T20:45:22Z")

</div>

I know it is not an easy option for 20 columns (and only returns the smallest index of the extreme values), but the Math Formula node's colmin, colmax functions might help in your case.

Cheers, gabor

Sorry, in the previous version I used argmin and argmax, but colmin and colmax are better fit in this case.

---

<div class="post-metadata">

**Author:** ![richards99](https://forum-cdn.knime.com/user_avatar/forum.knime.com/richards99/32/48547_2.png) [@richards99](https://forum.knime.com/u/richards99)\
**Post date:** [September 11, 2014, 9:48am UTC](https://forum.knime.com/t/how-to-report-the-column-name-from-column-scores/6633/3 "2014-09-11T09:48:15Z")

</div>

Hi Gabor,

Thanks, I understand this now. It took me a few minutes, its giving me the column Index. This is most useful, and has turned out to be easier than I thought it was going to be.

However, it only reports one column index, how can I get two column indexes when there is a tie ?

Many thanks,

Simon.

---

<div class="post-metadata">

**Author:** ![Aaron\_Hart](https://forum-cdn.knime.com/user_avatar/forum.knime.com/aaron_hart/32/7814_2.png) [@Aaron\_Hart](https://forum.knime.com/u/Aaron_Hart)\
**Post date:** [September 11, 2014, 11:56am UTC](https://forum.knime.com/t/how-to-report-the-column-name-from-column-scores/6633/4 "2014-09-11T11:56:00Z")

</div>

Here is an alternate&nbsp;way to do it based on the unpivot and groupby nodes. If performanace is more important than readability I would probably write a java snippet. &nbsp;

- [floorcolumns.zip](https://www.knime.com/sites/default/files/floorcolumns.zip)

---

<div class="post-metadata">

**Author:** ![richards99](https://forum-cdn.knime.com/user_avatar/forum.knime.com/richards99/32/48547_2.png) [@richards99](https://forum.knime.com/u/richards99)\
**Post date:** [September 11, 2014, 1:10pm UTC](https://forum.knime.com/t/how-to-report-the-column-name-from-column-scores/6633/5 "2014-09-11T13:10:46Z")

</div>

Very nice Aaron, you made light work of that. This will be really useful. I need to learn to use these Pivot nodes more often

Thanks,

&nbsp;

Impressed!

Simon.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:23pm UTC](https://forum.knime.com/t/how-to-report-the-column-name-from-column-scores/6633/6 "2023-06-23T20:23:31Z")

</div>

Closed on June 23, 2023, 8:23pm UTC


