2

I'm trying to number a grid from 120 rows by 120 columns: horizontal ABC, vertical 123 using Algorithm ID: 'native:creategrid' and Algorithm ID: 'QgisregularPoint'.

Numbering vertically isn't a problem. Numbering horizontally using is. Numbers should become characters.

I use:

char(65 + ("hor"%26)) || char(65 + round("hor"/26, 0))

thinking that if "hor" == 13, the result should be NA but it gives me NB.

I cannot find out what I am doing wrong. Take a look at the table:

enter image description here

0
3

Instead of round() use the floor() function:

char(65 + ("hor"%26)) || char(65 + floor("hor"/26))

It will always round down the result, which is what you want in your case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.