I'm creating an atlas in QGIS showing bus lines, tax fare zones, and travel flow lines.
I have a layer with bus lines - one feature per bus line.
Moreover, I have a layer with travel flow lines - there are many features per bus line.
Both layers have a common attribute column describing the bus line.
What I want is to show the travel flows lines that corresponds to a certain bus line.
Hence, I created an atlas via the atlas feature, where the coverage layer is featuring the bus lines.
In the travel flow line layer properties I made a rule based symbology, in order to only showing the travel flow lines that corresponds to each bus line.
In the filter I put: "Rute" = attribute( @atlas_feature , 'Rute')
Now I want to style each travel flow line feature double. The line width in accordance to the amount of travellers per flow line (called 'rejsende_a') but also styled from a blue color ramp, the higher amount of travellers, the darker blue.
Here is my problem. I want QGIS to style the color of the lines from a expression, as you can see from the picture below.
I need to find the minimum and maximum values of the travel flow lines to the corresponding bus line that is the current atlas feature.
So far I've tried several expressions. The latest one is like:
ramp_color('Blues', scale_linear(Rejsende_a, minimum(CASE When "Rute" = attribute(@atlas_feature, "Rute") Then "Rejsende_a" end),maximum((CASE When "Rute" = attribute(@atlas_feature, "Rute") Then "Rejsende_a" end)), 0,1))
Be aware that: Rute = bus line and Rejsende_a = travellers
But apparently the syntax is wrong.
Can anybody help out here? Can you use 'CASE WHEN' in the expression string? Or how can you tell the expression to choose only the feature from the travel flow lines that has the "Rute" column in common?