0

I would like to configure the labels so that they can meet these conditions:

  • a label by unique "MeasurementPointName"
  • for each unique value "MeasurementPointName" + "JarNam", display the values ​​"MeasurementPointName" + "JarFrom"+"JarTo" + all "ParameterName"+"ParamaterMeasuredValue"

Attribute table:

enter image description here

Expected result : F12 (20-50) Benzo(k)fluoranthène (*) (**) : 3,3 ; Benzo(ghi)Pérylène : 3,9 ; Chrysène : 6,8 ; Benzo(a)pyrène : 7,2 ; Benzo(b)fluoranthène : 9,6 ; Fluoranthène : 12 ;

2
  • Is this a table with geometries (does each MeasurementPointName entry in this table have an associated geometry). Or is this just a table without geometries and location of each Measurement Point Name reside in another layer ? Another question, do you have similar MeasurementPointNames with different JarNames or from/to values ?
    – Kasper
    Commented Dec 3 at 8:21
  • 1. Each MeasurementPointName entry in this table have an associated geometry. The geometry is the same for the same MeasurementPointName. 2. Yes i may have similar MeasurementPointNames with different JarName and from/to values. Commented Dec 3 at 8:52

1 Answer 1

1

What you can do is:

Add a column to your existing layer to combine Parameter and measurements, you can call it Measure and the formula is the following:

concat(ParameterName,': ',ParameterMeasuredValue) This will create all the sub-strings with parameter: value enter image description here

Then create a Virtual layer that will group MeasurementPointName and concatenate the desired Label string.

Create a virtual layer with this query:

select MeasurementPointName,JarName, concat(MeasurementPointName,' (',JarFrom,'-',JarTo,') ',group_concat(Measure,' ,')) as Label, geometry from output_table group by MeasurementPointName,JarName,JarFrom,JarTo,geometry

where Measure is the name of the predefined field, and output_table it the name of your MeasurementPointNames

enter image description here

This layer now has a column with your desired Labels and the related geopetry.

enter image description here

enter image description here

3
  • Thanks that's awesome ! Is this a way to include similar MeasurementPointNames with different JarName and from/to values. Exemple : F12 (20-50) Benzo(k)fluoranthène () (*) : 3,3 ; Benzo(ghi)Pérylène : 3,9 ; F12 (50-90) ; Chrysène : 6,8 ; Benzo(a)pyrène : 7,2 ; Benzo(b)fluoranthène : 9,6 ; Fluoranthène : 12 ; Commented Dec 3 at 9:28
  • The "Group by" part will make sure there is one line per combination of anything you ask to "group by". So here it will distinguish combinations of different from/to etc... Let me adapt it to include the geometry as well. Content d'aider ;)
    – Kasper
    Commented Dec 3 at 9:47
  • I updated the answer to include the geometry. As you can see, F12 with different from/to results in 2 labels.
    – Kasper
    Commented Dec 3 at 10:05

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.