Skip to Content
author's profile photo Former Member
Former Member

Formula within a formula

Hi,

I have a type of product (PF Glass) that is determined by part number. I want to be able to maintain this in one place.

Criteria currently is as follows, but WILL change:

(pn >= 100016 and pn <=1000018) or pn = 1000020 or pn = 1155020 or (pn >= 1900000 and pn <= 1975125) or

pn = 1976125 or (pn >= 1977320 and pn <= 1999050) or (pn >= 4904030 and pn <= 4999025) or (pn >= 6915020 and pn <= 6980020)

I need to know how to assess the evaluation order so if I use this to set a "flag" (formula PF Glass = Y) that can be used inside other formulas. I need this because I need to exclude these part numbers in other product types.

I've never been clear about all the evaluation times in CR, if someone can educate me on this...

Thanks,

Matt

ps; if anyone cares to comment, I usually compose outside of this forum and cut and paste, but IE 11 doesn't seem to want to let me... (Ctrl-C, Ctrl-V)

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Jan 08, 2014 at 06:01 PM

    Hi Matt,

    Reduce the code to:

    pn IN [100016 to 1000018] OR

    pn IN [1900000 to 1975125] OR

    pn IN [1977320 to 1999050] OR

    pn IN [4904030 to 4999025] OR

    pn IN [6915020 to 6980020] OR

    pn IN [1000020, 1155020, 1976125]

    Where do you plan to use the flag?

    If you evaluate the formula against database fields on the details section to check whether the formula = Y or N, then the evaluation time has to be the same as the record on the details section (whilereadingrecords).

    Such formulas can be accessed in other formulas *that also evaluate at the same time or later*.

    P.S: Of course, this is Not the greatest explanation for the evaluation times in CR as there is more to it.

    Hit the F1 button and type in "What is a pass" for more info.

    -Abhilash

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2014 at 05:59 PM

    oops...please ignore and see Abhilash's response below...stuff below is if you're calling that formula from another formula.

    hey Matthew,

    you may wish to look into EvaluateAfter({@formula}) so that you can set the order. this is handy for cases when you're using flags etc. so if you've got formulae that are all in the same sections etc. you can specify which ones fire after the other.

    if you do EvaluateAfter({@abcd}) and abcd is a whileprintingrecords formula, then this new formula should evaluateafter abcd, whileprintingrecords. please note that you can't make something override sectional evaluations...i.e. if something's in report header A, you can't make it evaluate after something in a report footer.

    cheers,

    jamie

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2014 at 06:12 PM

    Am I able to mark two answers as Correct?

    They're both helpful, but are both more than that.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.