Filling a field with automatic numbering specific by unique value of another field with QGIS expression
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have a table with 2 fields: NUMBER (integer) and TOWN (text).
I would like to find an expression that fills the NUMBER field with an automatic number specific for each value of TOWN.
Example:
NUMBER | TOWN
----------------------
1 | STRASBOURG
2 | STRASBOURG
3 | STRASBOURG
1 | PARIS
2 | PARIS
1 | TOULOUSE
2 | TOULOUSE
3 | TOULOUSE
4 | TOULOUSE
How can I do that with a QGIS expression ?
qgis expression
add a comment |Â
up vote
1
down vote
favorite
I have a table with 2 fields: NUMBER (integer) and TOWN (text).
I would like to find an expression that fills the NUMBER field with an automatic number specific for each value of TOWN.
Example:
NUMBER | TOWN
----------------------
1 | STRASBOURG
2 | STRASBOURG
3 | STRASBOURG
1 | PARIS
2 | PARIS
1 | TOULOUSE
2 | TOULOUSE
3 | TOULOUSE
4 | TOULOUSE
How can I do that with a QGIS expression ?
qgis expression
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a table with 2 fields: NUMBER (integer) and TOWN (text).
I would like to find an expression that fills the NUMBER field with an automatic number specific for each value of TOWN.
Example:
NUMBER | TOWN
----------------------
1 | STRASBOURG
2 | STRASBOURG
3 | STRASBOURG
1 | PARIS
2 | PARIS
1 | TOULOUSE
2 | TOULOUSE
3 | TOULOUSE
4 | TOULOUSE
How can I do that with a QGIS expression ?
qgis expression
I have a table with 2 fields: NUMBER (integer) and TOWN (text).
I would like to find an expression that fills the NUMBER field with an automatic number specific for each value of TOWN.
Example:
NUMBER | TOWN
----------------------
1 | STRASBOURG
2 | STRASBOURG
3 | STRASBOURG
1 | PARIS
2 | PARIS
1 | TOULOUSE
2 | TOULOUSE
3 | TOULOUSE
4 | TOULOUSE
How can I do that with a QGIS expression ?
qgis expression
qgis expression
asked 1 hour ago


Etienne
854
854
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
Finally, I found the right expression to do that:
"TOWN" ||( @row_number - minimum( @row_number , "TOWN") +1)
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Finally, I found the right expression to do that:
"TOWN" ||( @row_number - minimum( @row_number , "TOWN") +1)
add a comment |Â
up vote
3
down vote
Finally, I found the right expression to do that:
"TOWN" ||( @row_number - minimum( @row_number , "TOWN") +1)
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Finally, I found the right expression to do that:
"TOWN" ||( @row_number - minimum( @row_number , "TOWN") +1)
Finally, I found the right expression to do that:
"TOWN" ||( @row_number - minimum( @row_number , "TOWN") +1)
edited 10 mins ago
ahmadhanb
19.5k21846
19.5k21846
answered 24 mins ago


Etienne
854
854
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f299975%2ffilling-a-field-with-automatic-numbering-specific-by-unique-value-of-another-fie%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password