Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

5

Try something like: u'\u0305'.join([KOM_KOD]) See: Make overlines in python


1

With the help of M Bain I found a solution, because the number of monthes are only 6, 12, 24 and 35. So I did i like this and choosed for the special dates the last existing date: case when day( "date")='31' and month( "date" ) ='03' and "months"=6 then to_date(concat(year("date"), '-09-30' ) ) when day( "date")='31' and month( "date" ) ='05' and "...


6

You could replace '.qgs' by nothing '' in your expression: replace( @project_filename , '.qgs', '') As J.R pointed out, you could also select the whole filename, minus the last 4 characters substr( @project_filename ,1,-4)


5

What a shame the to_interval expression treats each month as 30 days! Here's an ugly expression which will do what you want: to_date(concat(year("date")+floor((month("date")+"months"-1)/12), '-', right('0' || ((month("date")+"months"-1)%12+1) , 2),'-', right('0' || day("date"),2))) It breaks the date down into year, month and day, then uses ...


0

Not at all an elegant solution but it works. For those who are still glued to QGIS 2.18. Let's assume there is a vector layer with the following attribute table. So, the main idea is to select the latest date by expression. It could be feasible by means of the expression that must be pasted in 'Select feature using an expression'. And then press Select. ...


1

The issue is, that this is not a "date" format. QGIS uses the international date format which looks like this: yyyy-MM-dd. See ISO 8601 on Wikipedia. Luckily you can re-format your string to a date using QGIS expressions and then select the maximum of it. Use this expression: maximum( to_date( to_string( array_get(string_to_array( "...


Top 50 recent answers are included