Skip to main content

Hi, 

 

I am reconciling the tableau formulas in my workbook and there are few metrics define and but the data of these metrics showing wrongly. 

 

Tableau Calculations Needed - Logic not working -Data Mismatch

 

1. Immediate Approval-without changes : 

COUNT(  

IF [Status] = 'Approved'  AND CONTAINS(UPPER([Comments]), 'APPROVED')   

   AND CONTAINS(LOWER([Comments]), 'approved')   

   //AND CONTAINS([Subject], 'RESIS Approval')   

   AND {fixed [Latest Version: Full Title],[Status]:count([Comments])} <= 1  

THEN [Document Number]   

END ) 

 

Total is 7 BUT its showing as 6, the formula is not working  

 

2) % Immediate Approval is # Tickets/ Immediate Approval-without changes and this is showing the wrong values 

 

3) Avg Turn around for Immediate Approval-without changes : 

 

i am using this formula  

{fixed [Latest Version: Publication Lead Function]:avg(  

 

IF {FIXED [Document Number],[Latest Version: Publication Lead Function]: min({fixed [Document Number],[Latest Version: Publication Lead Function]:[Immediate approval (no changes requested)]})} = 1   

 

THEN DATEDIFF('day', [Created Date], [Completed Date])  

 

END  

 

)} 

 

The values are showing wrongly,  

Ex:  1,10,9,10,10,8,13  Avg is 9 days but its shwoing wrongly. 

 

4) Average Turn Around Time- Changes Requested (days) 

 

{fixed [Latest Version: Publication Lead Function]:avg( 

IF {FIXED [Document Number],[Latest Version: Publication Lead Function]: min({fixed [Document Number],[Document Scope],[Assigned To: Full Name],[Latest Version: Publication Lead Function]:[Approval (changes requested)]})} = 1  

THEN DATEDIFF('day', [Created Date], [Completed Date]) 

END 

)} 

 

This is nothing but approvals anything more than 1 in comment,  the values are showing wrongly. 

 

Need some guide to validate these formulas and need help, Thanks 

2) 

 

 

 

#Tableau Desktop & Web Authoring

2 answers
  1. Apr 9, 1:50 PM

    @i p

     

    Hi, here are my comments. I created an approved status calculation:

    {FIXED [Document Number]:

    IF MAX([Status] = 'Approved'

    AND CONTAINS(UPPER([Comments]), 'APPROVED'))

    AND COUNT([Comments])> 1

    THEN "Approved with Changes"

    ELSEIF MAX([Status] = 'Approved'

    AND CONTAINS(UPPER([Comments]), 'APPROVED'))

    AND COUNT([Comments])= 1

    THEN "Approved without Changes"

    ELSE "Not Approved"

    END

    }

     

    With this simple variable, you can merge all the info in a single sheet, using simple COUNTD.  Finally, for the turn around, you may use:

    {FIXED [Document Number]:

    IF MAX([Approved Status])<>"Not Approved" THEN

    DATEDIFF("day",MIN([Created Date]),MAX([Completed Date]))

    END

    }

    Finally, you may get a Dashboard like this: 

     

    Hi, here are my comments.

     

    Note that to simplify filtering, I created a Min Create Date field. 

     

    If this post resolves the question, would you be so kind to "Accept this Answer"?. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you. 

     

    Regards, 

     

    Diego Martinez 

    Tableau Visionary and Tableau Ambassador 

0/9000