[Qgis-user] How fill the attribute table with a fixed-lenght codeblock value

Blumentrath, Stefan Stefan.Blumentrath at nina.no
Thu Nov 26 03:04:53 PST 2015


Did you try the "lpad" function (in String)?
Cheers
Stefan

-----Original Message-----
From: Qgis-user [mailto:qgis-user-bounces at lists.osgeo.org] On Behalf Of Andrea Peri
Sent: 26. november 2015 12:00
To: qgis-user <qgis-user at lists.osgeo.org>
Subject: [Qgis-user] How fill the attribute table with a fixed-lenght codeblock value

Hi,

I need to fill a filed with a code block like this:

"0001"
"0002"
"0003"
...
"0010"
"0011"

I see the caluclator has the "$rownum" variable, but the result will be this:

"1"
"2"
"3"
...
"9"
"10"

And this is not affordable because the lenght is not costant for us need.

I dont know if there is a solution to allow a fixed-length code-block value in the qgis calculator.

Thx

A.

--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user


More information about the Qgis-user mailing list