But I not sure if that will help me out. I have the information for in- and outpatients in a single field in my data (Field "out/in" > see attached image). If I use count or sum as the expression, how can I aggregate all records with status "A" for outpatients and "S" for inpatients?
And I want to have this KPI dynamic. So, if I will filter for e.g. the unit I want to have the outpatient-to-all-ratio just for the specific unit.
It's a good idea. I wonder why you make it so hard in the second part of the equation. wouldn't it work with count([out/in]). You basically take together all fields no?
Another way to start testing the formula, is in a 'text object' on your presentation sheet. If you create 2, and you test both the first part and the second part of your formula. If those 2 parts give you the desired results, you enter a third which tests the complete formula. If that one is ok, you copy this to your expression field.
But it just led to the same results that I have shown above. For all years the ratio is 100%. As you suggested I tried the different parts in three different charts and it led to the right absolute values as you can see in the screenshot. But as soon as I combine the parts of the expression it doesn't work.