top of page

Update the logic with Pyspark script

Requirement

Requirement: Update the attached Pyspark script only for the logic mentioned below.

 

Logic:

 

* Update existing Bonus Eligibility as 'Yes' as sales_amount is greater than 25000 and remains same logic for others.

* Update existing performance_flag, if sales_amount greater than 9000 mark as High, if sales_amount less than or equal to 9000 and greater than 7000 mark as Medium, others mark as Low.

* Update existing product_perf_band if sales_amount is greater than 10000 mark as Excellent, if sales_amount is greater than 8000 mark as Good, if sales_amount is greater than 5000 mark as Moderate.

* Add the new column rep_tier, if total sales_amount is greater than 45000 mark as Platinum Plus, if total sales_amount greater than 35000 then rep_tier should be Platinum, if total sales_amount is greater than 25000 then mark as Gold, below 25000 mark as Silver.

 

Final Output: Update the script as per above logic.

Purgo AI Agentic Code

bottom of page