Skip to main content
Question

Set Column Order

  • January 28, 2014
  • 2 replies
  • 81 views

travisk
Is there a way to change the column /  field order by a attribute value?
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.

2 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • January 28, 2014
I think you would have to make a script, python or tcl, to generate a outputschema based on the attribute u want to order.

 

That would involve a workspacerunner probably.

takashi
Celebrity
  • January 29, 2014
Hi,

 

 

Do you perhaps need to swap multiple attribute values by ascending order like this?

 

Input attribute name : value

 

FieldA : 3

 

FieldB : 1

 

FieldC : 2

 

Output attribute name : value

 

FieldA : 1

 

FieldB : 2

 

FieldC : 3

 

 

If so, one possible way is to use a list attribute.

 

1) Convert target attributes to a list attribute (AttributeRenamer).

 

FieldA --> _list{0}

 

FieldB --> _list{1}

 

FieldC --> _list{2}

 

 

2) Sort the list elements (ListSorter).

 

 

3) Recover the original attribute names (AttributeRenamer)

 

_list{0} --> FieldA

 

_list{1} --> FieldB

 

_list{2} --> FieldC

 

 

Takashi