Please attach Sample data.
Based on your sample data, and my assumption that I believe you want to make sure that the start and end date are the same for the tasks you're comparing, you can use a calculation like this:
if max([taskname]) = "ghi" then and
lookup(max([startdate]),-1) = max([startdate]) and lookup(max([enddate]),-1) = max([enddate]) and
lookup(max([taskname]),-1) = "def"
then 1 else 0
Make sure it calculates using table (down)
Hi Deepak. I don;t see any attachment.
Hi Paul. the start date of task name 'GHI' should be greater than the end date of the previous task(DEF). I can do the max of the task name but the same task name occurs multiple times and each time it can have a different predecessor
Right, so you didn't explain any of that in your original post. I took a guess at your original requirements, but without you explaining in detail what you are looking to do, and what you've tried so far, I have no way of knowing.
Your best best for getting this solved it to share a workbook with how your data is structured, and tell us what you've tried, and include a mockup of what you want the solution to look like. Otherwise we won't know how to help you.
I will try my best here to explain the requirement. I'm sorting out the below data based on the task assigned and task closed date ascending orded in excel. In tableau,I will like to build a calculation that if the task title is Aman, check the predecessor task name. THis is done by comparing the task assigned date of task 'Aman' with the task closed date of the previous task. If task name is aman and predecessor task name is testing then 'testing' else if task name is aman and predecessor task name is Post Production then Production. the task assigned date of aman can be equal or greater than the previous task name.
Ok, that makes sense. Thanks for explaining in detail and sharing the screenshot.
To recap what you're looking to do, for tasks labelled "Aman", look at the previous task. Check if the Aman task assigned date is the same or greater than the previous task. If it is, and the previous task is "Testing" then return "Testing" or if it's "Post Production" then return "Production".
You can do that like this:
if attr([Task Title]) = "Aman" and attr([Task Assigned Date]) >= lookup(attr([Task Assigned Date]),-1) then
if lookup(attr([Task Title]),-1) = "Testing" then "Testing"
elseif lookup(attr([Task Title]),-1) = "Post Production" then "Production"
Let me know if that works for you. If you get an error when trying it, please take a screenshot of the error so I can help troubleshoot.