Redash pivot : expandable grouping by month

I want to create expandable structure like this with pivot table result

I have some what created a pivot table and achieved desired result like these

i m only not able to put expandable structure and grouping total by each month

My query is a wrapper query like this , what more can i try in redash

count(Case_ID) AS ‘Count of Case ID’,
round(sum(Unit_Price),2) AS ‘Sum of Unit Price’,
round(sum(Gross_Sale_List)) AS ‘Gross_Sale For List Price’
( SELECT cast(convert_tz(rlic.dateapproved_c, ‘UTC’, ‘US/Central’) AS date) AS ‘Date’,
concat(u.first_name,’ ‘,u.last_name) AS ‘Analyst Group::multi-filter’,
( AS Invoice_Type,
(lc.case_id_c) AS Case_ID,
concat(l.first_name,’ ‘,l.last_name) AS ‘Client’,
WHEN rlic.for_entity_c = ‘Individual’ THEN ‘Individual’
END) AS ‘Entity’,
rlic.product_catalog_type_c AS ‘Invoice Type Group::multi-filter’,
(rli.likely_case) AS ‘Unit_Price’,
(rli.list_price) AS ‘list_Price’,
rli.quantity AS ‘Quantity’,
(rli.quantityrli.likely_case) AS ‘Gross Sale’,
rli.list_price) AS Gross_Sale_List,
WHEN rlic.recurring_type_c IS NULL THEN rli.likely_case
ELSE rlic.total_due_c
END) AS ‘Total Billed’,
(rlic.amount_paid_c) AS ‘Total Paid’,
WHEN rlic.recurring_type_c IS NULL THEN rli.likely_case
ELSE rlic.total_due_c
END-(rlic.amount_credit_c+rlic.debit_amount_c))-rlic.amount_paid_c, 0 )) AS ‘Balance’,
rli.status AS ‘Invoice Status Group::multi-filter’,
epibc.business_service_status_c AS ‘Fpal Service Status Group::multi-filter’,
WHEN rlic.lead_from_c LIKE ‘%CTAX%’ THEN concat(coalesce(cc.ctax_status_c,’’),’ : CTAX’)
WHEN rlic.lead_from_c = ‘Monitoring’ THEN concat(coalesce(cc.tap_status_c,’’),’ : Monitoring’)
WHEN rlic.lead_from_c = ‘FPal’ THEN concat(coalesce(cc.fpal_status_c,’’),’ : FPal’)
WHEN rlic.lead_from_c = ‘BAM’ THEN concat(coalesce(cc.fpal_status_c,’’),’ : BAM’)
WHEN rlic.lead_from_c IS NULL THEN ‘UNRELATED’
WHEN rlic.lead_from_c = ‘’ THEN ‘UNRELATED’
END AS ‘Client Status’,
rlic.years_list_c AS ‘Years’,
rli.description AS ‘Description’,
c.date_entered AS ‘Create Date’,
rlic.sale_type_c AS ‘Sale level’
FROM revenue_line_items rli
INNER JOIN revenue_line_items_cstm rlic ON
AND rli.deleted = ‘0’
AND rlic.lead_from_c = ‘FPal’
AND rlic.dateapproved_c IS NOT NULL
INNER JOIN product_templates pt ON
INNER JOIN leads l ON rli.opportunity_id = l.opportunity_id
AND l.deleted = ‘0’
INNER JOIN leads_cstm lc ON
AND l.first_name NOT LIKE ‘%test%’
AND l.last_name NOT LIKE ‘%test%’
LEFT JOIN contacts c ON = l.contact_id
INNER JOIN contacts_cstm cc ON cc.id_c =
LEFT JOIN users u ON = rlic.user_id2_c
AND u.deleted=0
LEFT JOIN epi_business_revenuelineitems_1_c ebr ON ebr.epi_business_revenuelineitems_1revenuelineitems_idb =
LEFT JOIN epi_business epib ON = ebr.epi_business_revenuelineitems_1epi_business_ida
LEFT JOIN epi_business_cstm epibc ON epibc.id_c =
WHERE IN (‘7ec5821c-0405-11ea-bc5a-0a1db36945e2’,
AND rlic.product_catalog_type_c IN (‘Accounting -Misc’,
‘Tax Preparation’,
‘Accounting’) – AND rlic.service_parent_id_c IS NOT NULL
AND cast(convert_tz(rlic.dateapproved_c, ‘UTC’, ‘US/Central’) AS date) between
‘{{ Date Range.start }}’ and ‘{{ Date Range.end }}’
) P
GROUP BY MONTHNAME(Date), Invoice_Type
Invoice_Type ;