Skip to main content

Hello,

I need to generate data by year (whereas I only have periods)

To do this, I'll need to generate numbers between two values (typically years) to make a join with my existing data.

I thought of using counter but I need input data, I just want to generate all the numbers between two values (for ex 1791 to 2024)

thanks in advance for your help

 

I think you want a feature for each year between 1791 and 2024? One way to do this is:

  • Expected input is one feature with attributes FromYear = 1791 and ToYear = 2024.
  • Calculate the difference between the 2 years.
    • AttributeCreator
      • AttributeName: Years
      • AttributeValue: @Evaluate(@Value(ToYear)-@Value(FromYear))
  • Create a feature for each year.
    • Cloner
      • Number of Copies: Years
      • Copy Number: Year Number
  • Create a Year attribute for each feature
    • AttributeCreator
      • AttributeName: Year
      • AttributeValue: @Evaluate(@Value(FromYear)+@Value(YearNumber))

Thank you very much, I will try your solution !


Works perfectly !

 

Thanks a lot for the help!


Reply