Forum Discussion

EudonDelemar's avatar
EudonDelemar
Qrew Trainee
5 years ago

Selecting a yes/no field and dividing a result.

My current issue is I have a field that calculates the total number of printers needed per site (Total printers required field).  That part works fine. Now I need to add an additional field that is a Yes/No question and if the answer is NO, then it will need to divide the number in the Total printer required field by half.

Fields currently:
High volume site - Yes/No
              If NO then divide the number in the "Total printers required field"
              IF YES then do nothing
Total printers required field  ( this is a formula field that subtracts from 2 other fields to get the totals.)

How will i tell QB if the NO answer is selected then cut the number in the Total printer required field in half and return the result in the same Total printers required field?

Any help will be greatly appreciated, I believe part of the issue is the fact that i have text and numeric formula fields.

Thanks in advance.

------------------------------
Mr Delemar
------------------------------

4 Replies

  • Update your formula field to include an IF statement

    If(
    [High volume site]="No", ([some field]-[some field])/2,
    [some field]-[some field])

    post your actual formula if you need help adding the IF statement


    ------------------------------
    Everett Patterson
    ------------------------------
    • EudonDelemar's avatar
      EudonDelemar
      Qrew Trainee
      Thanks,

      I think this is the right direction. The issue i have is as follows:
      High Volume field is a text-multiple choice lookup field to get the yes or no answer
      Surveyed printer field is also a lookup numeric field
      Required printer field is Numeric field, user inputs number
      Total New printers

      Currently the Total new printer field has this formula
      Surveyed printer field - Required printer field

      So what i would need to happen is the following:
      IF High Volume is Yes, do nothing, let the formula in total printers field subtract the 2 fields.
      IF High Volume is NO, then Surveyed printer field - Required printer field /2 and that answer should go in the Total New printers field.

      Hopefully this makes sense.

      Thanks again

      ------------------------------
      Mr Delemar
      ------------------------------
      • EverettPatterso's avatar
        EverettPatterso
        Qrew Captain
        Use this formula for Total new printer, make sure your fields in [] are correct

        If(
        [High Volume]="Yes", [Surveyed printer} - [Required printer],
        [High Volume]="No", ([Surveyed printer} - [Required printer])/2)​


        ------------------------------
        Everett Patterson
        ------------------------------
  • I would change your "Total printers required field" to just "Total printers". Then add a formula field called "Required printers"; this will be the field you would use to monitor the number of required printers based on the yes/no selection. Then use your IF logic in the "Required printers" field:

    IF(
    [High Volume] = true,
    [Total printers] / 2,
    [Total printers]
    )


    ------------------------------
    Adam Keever
    ------------------------------