This is a public Forum  publicRSS

Topic

    JJ
    Simple questions of IF/ELSE statementsAnswered
    Topic posted August 9, 2018 by JJMaster 
    17 Views, 2 Comments
    Title:
    Simple questions of IF/ELSE statements
    Content:

    I have a variable as follows in a report:

    date_diff(incidents.closed,incidents.created)/1

    I have a column defined as the following:

    if($t <= 604800,1,if($t <= 1209600,2,if($t <= 1814400,3,if($t <= 2419200,4,if($t <= 3024000,5,if($t <= 3628800,6,if($t <= 4233600,7,if($t <= 4838400,8,if($t <= 5443200,9,if($t <= 6048000,10,if($t <= 6652800,11,if($t <= 7257600,12,if($t <= 7862400,13,14)))))))))))))

    Am I right in thinking for less than 1209600, it won't include anything less than 604800 or will it include that as well?

    Second part of the question is that I want to see *everything* under a particular amount. If my assumption above is correct, how would I go about this?

    Best Answer

    Sebastiaan

    Multiple IF's can be quickly confusing. I always prefer a different approach (when possible). See attached example on alternative logic.

    Answer