Calculation inside ifelse statement

Hi all,
I have below formula, but it is not working as expected, could you advise what is the problem and how to fix it?

ifelse
(
{LSP}=‘ABC’ AND {ship_mode}=‘AIR’, 0 , distinct_countIf({shipment_id}, {ontime_status}=‘ON TIME’/distinct_count({shipment_id}
)

Hi @ldovan

Welcome to the QuickSight community! :slight_smile:

For us to be able to help you, could you please share:

  1. What are you trying to achieve through the formula?
  2. Sample dataset with appropriate rows and columns
2 Likes

@SD_QS Thanks for your feedback.
What I am trying to do is that: If I have a forwarder named “ABC” and the ship mode is “AIR”, then I dont need to calculate the on-time performance (and consider as “0”), else I will calculate the percentage based on other logic.
Sorry I cannot share the dataset.

Thanks @ldovan
So, whats the error you’re facing? Is it a syntax error or logical error? Would be helpful if you could post error screenshot. Also, I dont expect you to share the actual data but just a masked representative data.

Hi @ldovan

We have not heard back from you regarding your question. We would still like to help. If we do not hear back in the next 3 days, we will archive the question.