Wednesday 18 July 2018

qgis - How to add a sequence to the attribute table?


Is there a way to use the field calculator in QGIS to create a range of values in a count sequence with a specified input range? For example, if I wanted to have the values 1 to 5 repeated within my table according to the first record in the table.


Thanks...



Answer



This will do it in Field Calculator:


 ( $rownum-1 ) % 5 +1

enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...