I am trying to use the expression editor on the legend item in the layout manager. My layer has the attributes of RU_NAME
which is the geological unit and LITH_SUMM
which is the description. Unfortunately the layer is huge and has colouring and categories set up by our local government department so I cannot just reclassify without loosing all of the colour and symbology styles.
Concat(@symbol_label,': ',"LITH_SUMM")
Above is the code I am using which should give me the combined name and description of the rock units. The preview has the correct output, but when I click OK it results in [%Concat(@symbol_label,': ',"LITH_SUMM")%]
Is there something I am doing incorrectly with the code for this expression?
EDIT: Please see the screenshot below:
Our local government has released the shapefiles and styles for geological layers which are compliant to standards so I would not want to recategorize the layers based upon a new attribute. Doing this would overprint the colours and labels on a data set that has thousands of entries. The issue is that the legend only shows the symbols "Tp" instead of the description "Arkose sandstone with interbedded siltstone". The information is in the attribute table of the layer, I am just unsure how to get it to be displayed in the legend.
EDIT 2: See Below for additional information
I have attached an excerpt of the attribute table and the formatting style. The symbology has been set by the government to a standard colouring based upon RU_NAME
. There are thousands of these categories. I have combined the required information in the attribute table asLegendText = Concat("MAP_SYMBOL","RU_NAME","LITH_SUMM")
as an example of what I am trying to get to display in the legend text. I have tried to edit the layer style python and this guide:Using attribute data for legend labeling in QGIS? but I am definitely a novice at python and cannot get it to work.