Skip to main content
Solved

Row Values to Columns

  • February 29, 2020
  • 3 replies
  • 141 views

Forum|alt.badge.img

Hello,

I have summary output coming from the StatisticsCalculator that I would like to rearrange such that row values become column headings with values for these coming from the statscalc count output (see input and end result images below). I've tried AttributePivoter, AttributeTransposer without success.

Thanks.

Tony

Best answer by takashi

Hi @aviveiro, try this.

Firstly create a new attribute whose name is equal to the value of STOCKING and assingn the value of STOCKING_count to the new attribute, with the AttributeCreator as in:

Then, aggregate all the features using the Aggregator with Merge Incoming Attributes mode.

Finally expose the new attribute names (originally equal to values of STOCKING) with the AttributeExposer, then remove unnecessary attributes optionally.

The workflow looks like this.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

takashi
Celebrity
  • 7843 replies
  • Best Answer
  • February 29, 2020

Hi @aviveiro, try this.

Firstly create a new attribute whose name is equal to the value of STOCKING and assingn the value of STOCKING_count to the new attribute, with the AttributeCreator as in:

Then, aggregate all the features using the Aggregator with Merge Incoming Attributes mode.

Finally expose the new attribute names (originally equal to values of STOCKING) with the AttributeExposer, then remove unnecessary attributes optionally.

The workflow looks like this.


takashi
Celebrity
  • 7843 replies
  • February 29, 2020

Hi @aviveiro, try this.

Firstly create a new attribute whose name is equal to the value of STOCKING and assingn the value of STOCKING_count to the new attribute, with the AttributeCreator as in:

Then, aggregate all the features using the Aggregator with Merge Incoming Attributes mode.

Finally expose the new attribute names (originally equal to values of STOCKING) with the AttributeExposer, then remove unnecessary attributes optionally.

The workflow looks like this.

If you need to change Softwood and Hardwood to their abbreviation SW and HW, perform changing them before the AttributeCreator.


Forum|alt.badge.img
  • Author
  • 16 replies
  • February 29, 2020

Hi @aviveiro, try this.

Firstly create a new attribute whose name is equal to the value of STOCKING and assingn the value of STOCKING_count to the new attribute, with the AttributeCreator as in:

Then, aggregate all the features using the Aggregator with Merge Incoming Attributes mode.

Finally expose the new attribute names (originally equal to values of STOCKING) with the AttributeExposer, then remove unnecessary attributes optionally.

The workflow looks like this.

Terrific @takashi!

One thing I did have to do was manually type in the new attribute names (originally equal to values of STOCKING) in AttributeExposer because I didn't see them as attributes to expose.

Thank you.

Tony