Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm relatively new to QlikView and need your help!
I have data that should be aggregated by a certain criteria (Therapieklasse).
Therapieklasse can have 11 expressions (A, B, C, D, E, F, G, H, K, L, M).
Please see table below that describes the data structure of the input data in a simple way.
Patienten-ID | Datum | Therapieklasse |
111 | 01.01.2021 | A |
111 | 01.01.2021 | B |
222 | 02.01.2021 | A |
222 | 02.01.2021 | C |
333 | 03.01.2021 | D |
444 | 03.01.2021 | E |
444 | 04.01.2021 | F |
555 | 04.01.2021 | H |
555 | 05.01.2021 | K |
555 | 05.01.2021 | L |
666 | 05.01.2021 | M |
666 | 05.01.2021 | B |
777 | 06.01.2021 | B |
In the Diagram I want to display data like this:
Therapieklasse | Number of Patients with certain Therapieklasse | Number of Patients with certain Therapieklasse divided by number of all Patients (= 7 Patients) | Benchmark |
A | 2 | 28,57% | 30% |
B | 3 | 42,86% | 50% |
C | 1 | 14,29% | 20% |
D | 1 | 14,29% | 20% |
E | 1 | 14,29% | 15% |
F | 1 | 14,29% | 20% |
G | 0 | 0% | 5% |
H | 1 | 14,29% | 10% |
I | 1 | 14,29% | 5% |
K | 1 | 14,29% | 20% |
L | 1 | 14,29% | 25% |
M | 1 | 14,29% | 15% |
Benchmark data is connected by Therapieklasse and values do not change.
As you can see in my example data, there is no Patient with Therapieklasse G.
Unfortunately my pivot diagram does not show the "0" for Therapieklasse G and the Benchmark value of 5%. The line for Therapieklasse G (in the table above marked red) does not even exist.
How can I solve the problem, so that both Benchmark and Number of Patients with Therapieklasse G are shown even if there is no Patient with Therapieklasse G?
Thank you very much in advance!
Best regards, Stefanie
I do not see Therapieklasse G in the data model. If you have a master list of possible Therapieklasse values, you can concatenate the missing values. In some way you need to have a dimension that contains the list of dimension values to be displayed.
master_Therapieklasse:
load * inline [
master_Therapieklasse
A
B
C
D
E
F
G
H
I
J
]
;
data:
LOAD
*
(html, utf8, embedded labels, table is @1)
;
concatenate (data)
load
master_Therapieklasse as Therapieklasse
resident master_Therapieklasse
where not exists (Therapieklasse, master_Therapieklasse);
drop table master_Therapieklasse;
exit script;