Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have simple data as shown below:
Names | Marks |
A | 2 |
B | 3 |
C | 4 |
D | 5 |
E | 6 |
F | 7 |
G | 8 |
H | 9 |
I | 10 |
J | 11 |
K | 12 |
L | 16 |
M | 17 |
N | 20 |
O | 21 |
P | 34 |
Q | 50 |
Now I want to create a pie chart with 3 pies on it as: 1) Marks Less than 10
2) Marks Between 10-20
3) Marks Greater than 20
And show their percentages as shown. I don't know if I have to create groups or what. Please explain this in detailed manner as I am new to QlikView
Your script should look like this:
Main:
LOAD
*,
if(Mark < 10, '< 10', if(Mark < 20, '10 to 20', '> 20')) as Bucket;
LOAD * INLINE[
Name, Mark
A, 2
B, 3
C, 4
D, 5
E, 6
F, 7
G, 8
H, 9
I, 10
J, 11
K, 12
L, 16
M, 17
N, 20
O, 21
P, 34
Q, 50
];
In the chart properties select 'Bucket' for the Dimension. The expression will be 'count(Bucket)'. In the expression tab you will also want to check 'Relative' and 'Values on Data Points'.
I hope this helps!
I ran this script. I am getting this syntax error.
Looks like there is a space missing between INLINE and the [. Try this:
LOAD
*,
if(Mark < 10, '< 10', if(Mark < 20, '10 to 20', '> 20')) as Bucket;
LOAD * INLINE [
Name, Mark
A, 2
B, 3
C, 4
D, 5
E, 6
F, 7
G, 8
H, 9
I, 10
J, 11
K, 12
L, 16
M, 17
N, 20
O, 21
P, 34
Q, 50
];
It worked. Thanks a lot!!!