2

I have a model that does some tidying of attributes in vector layers that are stored in a geopackage. The geopackage to work with is specified with a file path input (@survey_data_package) Therefore the input layers to work on can be set using the "pre-calculated value" option and an expression like this

@survey_data_package || '|layername=TheLayerToWorkOn'

When I specify the output layer if I follow the same expression (such as below) it doesn't work - I suspect this is something to do with creating a new layer/table.

@survey_data_package || '|layername=TheLayerToSaveOutputTo'

If I manually set the geopackage and layer name the string looks like this

ogr:dbname='FilePath/Geopackage.gpkg' table="TheLayerToSaveOutputTo" (geom)

So I was hoping an expression like the one below would allow me to use a "pre-calculated value" and insert the date etc and standardise the file name. I have tried various possibilities like having the output table name as "myoutput" or myoutput

'ogr:dbname=' || 
@survey_data_package|| 
' table=' || 
'myoutput'  || 
'(geom)'
1
  • I think it must be '''myoutput''', cause it must have the double " before and after the name!
    – katagena
    Aug 10, 2023 at 20:13

1 Answer 1

2

This syntax worked

'ogr:dbname='
||  @survey_data_package  
|| ' table='
|| 'Survey_' 
||  format_date(now(),'yyyy_MM')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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