In QGIS python console, I can run the following to extract the week number from date column. How can I use the same in qgsExpression as a where clause? Any other option is welcome as long as it uses PyQGIS. I intend to filter a vector layer in QGIS to return records that match a particular week.
for x in layers: if x.name() == "test": idx = x.fieldNameIndex("date_from") values = x.uniqueValues( idx ) b =values print b.weekNumber() b.weekNumber()
This expression gives me an indication of the week number. Can I use QgsExpression like
expr = QgsExpression( "\"date_from.weekNumber()\" = 99" )?