Skip to main content
1-Visitor
Apr 12, 2013 6:28 PM UTC
Solved

Report Computed Fields: Challenge #1

The following report field computation flags an item with a 1 if its State on a specific date/time was 10 (i.e. Closed):

HistoricFieldValue(State,timestamp("Apr 1, 2013 11:59:59 PM")) == 14 ? 1 : 0.

However, I’d like to flag with a 1 if the historical State was 10 (Closed) or 41 (Canceled). I've made several attempts to no avail. Can you assist please?

    1-Visitor
    Apr 12, 2013 11:18 PM UTC

    Hi Anita,

    I don't have much experience with the HistoricFieldValue() itself, but I do enjoy computed fields .

    From how I see it, there are 2 ways to get the functionality you mentioned..

    The more straightforward way is to use parentheses to group the OR:

    ((HistoricFieldValue(State,timestamp("Apr 1, 2013 11:59:59 PM")) == 10) or (HistoricFieldValue(State,timestamp("Apr 1, 2013 11:59:59 PM")) == 41)) ? 1: 0

    An alternate way is to use nested ? operators:

    (HistoricFieldValue(State,timestamp("Apr 1, 2013 11:59:59 PM")) == 10) ? 1 : ((HistoricFieldValue(State,timestamp("Apr 1, 2013 11:59:59 PM")) == 41) ? 1 : 0 )

    Hope that helps,

    Matt

    2 replies

    1-Visitor
    Apr 12, 2013 11:18 PM UTC

    Hi Anita,

    I don't have much experience with the HistoricFieldValue() itself, but I do enjoy computed fields .

    From how I see it, there are 2 ways to get the functionality you mentioned..

    The more straightforward way is to use parentheses to group the OR:

    ((HistoricFieldValue(State,timestamp("Apr 1, 2013 11:59:59 PM")) == 10) or (HistoricFieldValue(State,timestamp("Apr 1, 2013 11:59:59 PM")) == 41)) ? 1: 0

    An alternate way is to use nested ? operators:

    (HistoricFieldValue(State,timestamp("Apr 1, 2013 11:59:59 PM")) == 10) ? 1 : ((HistoricFieldValue(State,timestamp("Apr 1, 2013 11:59:59 PM")) == 41) ? 1 : 0 )

    Hope that helps,

    Matt

    Translate
    AnitaD1-VisitorAuthor
    1-Visitor
    Apr 15, 2013 10:35 PM UTC

    thanks, Matt. I really appreciate your help.

    Translate