There are different types of group level available in the actual data set, We would be required different types of group-wise report. (Note: group wise report is not simple hence please read below example carefully)
Requirement Example
when we need to report 4th level group report then need to sum data field till the last value before 4th level. The report number might any number given in the "Group" column. (Kindly refer Expected output for more clarity)
For Rest of the filed, treatment as below:
purchase_date, Info1 & Info2: Pickup date available at the group level
data : Sum
Actual Database:
Group purchase_date Info1 Info2 data
2 03/23/2019 A B 57
3 03/24/2019 A B 48
4 03/25/2019 A B 40
1 03/26/2019 Q B 60
2 03/27/2019 Q B 42
3 03/28/2019 Q B 33
4 03/29/2019 Q B 36
1 03/30/2019 R B 54
2 03/31/2019 R B 57
3 04/01/2019 R B 53
4 04/02/2019 R B 56
1 04/03/2019 A B 48
2 04/04/2019 A B 40
3 04/05/2019 A B 45
4 04/06/2019 A B 60
1 04/07/2019 A B 38
2 04/08/2019 A B 58
Expected output after grouping data as per the above requirement:
4th group level report:
Group purchase_date Info1 Info2 data
4 03/25/2019 A B 145
4 03/29/2019 Q B 171
4 04/02/2019 R B 220
4 04/06/2019 A B 193
4 04/08/2019 A B 96
2nd group level Report
Group purchase_date Info1 Info2 data
2 03/23/2019 A B 57
2 03/27/2019 Q B 190
2 03/31/2019 R B 180
2 04/04/2019 A B 197
2 04/08/2019 A B 201
I have tried it with group by function but I am not able to Kick-off it.
Can anyone help me to get the desired output?
Thanks in advance.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)