Skip to main content
Solved

Give ID to pair of attributes

  • January 16, 2019
  • 6 replies
  • 24 views

geo-x
Supporter
Forum|alt.badge.img+6

Dear FME community.

I would like to give ID to pair of attributes with FME like that :

Thank you for your help.

Best answer by ebygomm

You can use the following expression in an attribute creator to calculate the ID_PAIR value

@Evaluate(10*@ceil(@Value(ID)/20))
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.

6 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3429 replies
  • Best Answer
  • January 16, 2019

You can use the following expression in an attribute creator to calculate the ID_PAIR value

@Evaluate(10*@ceil(@Value(ID)/20))

geo-x
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • 89 replies
  • January 16, 2019

You can use the following expression in an attribute creator to calculate the ID_PAIR value

@Evaluate(10*@ceil(@Value(ID)/20))

The numbers 10,20,30,40... are an example. In fact my numbers seems like 1760,2451,3210,4512... the most important is pair in order


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3429 replies
  • January 16, 2019

The numbers 10,20,30,40... are an example. In fact my numbers seems like 1760,2451,3210,4512... the most important is pair in order

In which case, if you add a counter starting at 1, then follow it with a similar expression you can get pairs which have a common id

@Evaluate(@ceil(@Value(_count)/2))

Depending on your input format, their may already be a value you could use instead of adding the counter, e.g. row number if a csv file

0684Q00000ArMxgQAF.png

 

 


geo-x
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • 89 replies
  • January 16, 2019

In which case, if you add a counter starting at 1, then follow it with a similar expression you can get pairs which have a common id

@Evaluate(@ceil(@Value(_count)/2))

Depending on your input format, their may already be a value you could use instead of adding the counter, e.g. row number if a csv file

0684Q00000ArMxgQAF.png

 

 

I don't know how can I make a counter with an ORDER BY clause...


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3429 replies
  • January 16, 2019

I don't know how can I make a counter with an ORDER BY clause...

If your features are already in order, only the counter is needed. If you need to order them first, then you need to put a sorter before the counter


geo-x
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • 89 replies
  • January 16, 2019

If your features are already in order, only the counter is needed. If you need to order them first, then you need to put a sorter before the counter

Great ! Thanks @egomm !