Hi Community,
I need some help on this logic in code editor to give % of completed orders at second time.
Sum(All Completed orders with conditional activity = 1 Reason) & Sum of all completed orders
There are multiple REASONS in Activity column but i need only completed orders with one REASON
Trying to calculate the % from a table based on certain activities but limited to the count = 1 .
Can you please help with the case statement how to get the % based on above. Here i want to get only count of REASON = 1 for the status & activity = completed for each case.
COUNT (DISTINCT CASE
WHEN
table.ACTIVITY = REASON
AND
table.status = COMPLETED AND
table.ACTIVITY like %COMPLETED%
THEN 1 REASON
WHEN
table.ACTIVITY != REASON
AND
table.status = COMPLETED AND
table.ACTIVITY like %COMPLETED%
THEN NO REASON
ELSE OTHERS
END
)
Thanks