Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Experts,
I have a dataset where defects are recorded as DefectNo, Defect Date, Costs Incurred, rootcause. Rootcause is not unique here, there could be 5 defects due to a single rootcause.
i am trying to make a chart for sum of coasts incurred due to top5 rootcauses by month.
Is there a way to achieve this in qliksense load script (please)- I understand Groupby groups Rootcauses, but i want to group by each month and then sum the top5.
I would want to have Month name on the x-axis, with bars for each month representing the sum of costs incurred only for the top 5 root causes please.
A model of the data is as below.
Defect No | Defect Date | Costs Incurred | Root cause |
1 | 15/05/2021 | $ 59.00 | Cause1 |
2 | 15/05/2021 | $ 98.00 | Cause2 |
3 | 18/05/2021 | $ 76.00 | Cause1 |
4 | 18/05/2021 | $ 76.00 | Cause4 |
5 | 19/05/2021 | $ 23.00 | Cause5 |
6 | 19/05/2021 | $ 43.00 | Cause6 |
7 | 19/05/2021 | $ 34.00 | Cause3 |
8 | 19/05/2021 | $ 76.00 | Cause7 |
9 | 19/05/2021 | $ 45.00 | Cause8 |
10 | 20/05/2021 | $ 50.00 | Cause1 |
11 | 20/05/2021 | $ 60.00 | Cause2 |
12 | 20/05/2021 | $ 23.00 | Cause1 |
13 | 20/05/2021 | $ 32.00 | Cause4 |
14 | 20/05/2021 | $ 345.00 | Cause5 |
15 | 18/05/2021 | $ 2,341.00 | Cause6 |
16 | 18/05/2021 | $ 1,234.00 | Cause3 |
17 | 18/05/2021 | $ 1,111.00 | Cause7 |
18 | 01/06/2021 | $ 567.00 | Cause8 |
19 | 02/06/2021 | $ 34.00 | Cause3 |
20 | 02/06/2021 | $ 76.00 | Cause7 |
21 | 02/06/2021 | $ 45.00 | Cause8 |
22 | 02/06/2021 | $ 50.00 | Cause1 |
23 | 02/06/2021 | $ 60.00 | Cause2 |
24 | 03/06/2021 | $ 23.00 | Cause1 |
25 | 03/06/2021 | $ 32.00 | Cause4 |
26 | 03/06/2021 | $ 345.00 | Cause5 |
27 | 04/06/2021 | $ 2,341.00 | Cause6 |
28 | 04/06/2021 | $ 1,234.00 | Cause3 |
29 | 04/06/2021 | $ 34.00 | Cause3 |
30 | 04/06/2021 | $ 76.00 | Cause7 |
31 | 04/06/2021 | $ 45.00 | Cause8 |
32 | 05/06/2021 | $ 50.00 | Cause1 |
33 | 05/06/2021 | $ 60.00 | Cause2 |
Many thanks in advance.
KL
Hi@KL1
in script ?
Yes, sorry saw the reply too late. I'd prefer to do it by script pls, if not possible by script only then temporarily do it in the charts.
Thankyou
@KL1 great can you also share the expected output from this sample ?