Please try this calculation and let me know if it is helpful.
If col X = 0 and col Y = "Yes" or Col Y = "No" then
Thanks for looking into this Tausif but this is not what I'm looking for
Thanks Zhouyi for your help, this points me in the right direction
1 of 1 people found this helpful
this solved 90% of my problem. However one point that this solution cant solve and its because I probably didnt explain my question properly earlier so here goes
Col X>0 and Col Y is Yes or No - this output is correct
Col X=0 and ColY is No - this output is correct
ColX>0 and Col Y is No - this output is wrong ( possibly because the condition we have for Case 1 is for ColY being Yes or No, so it seems when the third condition is run, the output is calculating the records generated previously as well)
Does this clarify my problem?
Thank you for your prompt help.
Just to add here,
There are order ids where col X>0 and col Y is Yes but this order id will have another row where col X>0 and col Y is No. This order id should be calculated in one bucket because the principal condition is for an order id to have atleast one row where col X>0 and Col Y as Yes.
The order ids where colX >0 and col Y as No can have single or multiple rows satisfying this condition but that is considered part of a separate bucket.
Can someone please help me with the above question, I'm hoping I was able to explain the requirement properly.
Please reach out to me with any pointer you may have for me or in case you need any clarifications.
Any pointers here will be much appreciated.
Moderator, can you please assist.
What's your issue with my solution, you haven't explained which part is not working.
Please supply an updated data set with examples of all the conditions that you are evaluating for and it would be helpful to have an extra column with the "expected status result" that we can use to check against the calculations in Tableau.
The solution you provided is not working because the logic I explained earlier was not completely clear.
The problem statement is as follows:
There are some records which have 3 columns, order id, col X and col Y
I need to create a calculated field, set, whatever is the best solution to display the count of order ids for the 3 conditions mentioned below
col X>0 and col Y="Yes" - these order ids should be kept separate and not be part of further calculations
after this,there are 2 more conditions
col X=0 ad Col Y ="No"
Col X>0 and Col Y="No"
Basically, I'm trying to segment the order ids into 3 unique buckets based on these 3 conditions.
The solution Naveen provided earlier was able to satisfy the first 2 conditions but it gave the wrong count for the 3rd. I believe this was because some order ids from the first condition were also included in this calculation which led to inflated count. This is why I believe we need to completely filter out the first set before working on the other 2 conditions.
Thank you for reaching out.