Analyzing Therapeutic Area-Wise Sales Growth Comparison: Q1 vs. Q2
Requirement
Introduction: This analysis focuses on comparing sales performance across various therapeutic areas during the first and second quarters of 2023. By examining sales growth trends, we aim to identify high-performing areas, uncover opportunities for improvement, and provide actionable insights to enhance sales strategies.
Requirements:
Read the table 'purgo_playground.hcp_overall_performance'
Extract the Year and Quarter from sales date column, Calculate Sales per Therapeutic Area per Quarter. Pivot the quarterly sales data for Sales Comparison with therapeutic area by both first quarter(Q1) and second quarter(Q2) of 2023. Generate the growth Percentage column from Q1 to Q2.
Final Output: Show the results column of Therapeutic area, Year, Q1_Sales, Q2_Sales, Growth percentage by top sales growth.
write the pyspark code without syntax error.
Unity catalog: purgo_playground.hcp_overall_performance