IIf issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jlf
    New Member
    • May 2006
    • 12

    #1

    IIf issue

    I am attempting to get a total of production per each shift of work, which there are 3. The below expression works fine for Shift 1, but Shift 2 and 3 are showing blank values. I rearranged the expression, but then Shift 2 and 3 show the same duplicated value as Shift 1.

    =IIf([Shift]="1",(Sum([qtyproduced]))/((Sum([qtyruntime]+[timedown])*[piecesperhour])))

    =IIf([Shift]="2",(Sum([qtyproduced]))/((Sum([qtyruntime]+[timedown])*[piecesperhour])))

    =IIf([Shift]="3",(Sum([qtyproduced]))/((Sum([qtyruntime]+[timedown])*[piecesperhour])))

    When I take out the first "Sum", that is when I get duplicated values in Shift 2 and 3.

    Any suggestions would be greatly appreciated. I'm very new to this type of work.

    Thanks,
    JLF
  • CaptainD
    New Member
    • Mar 2006
    • 135

    #2
    What are the 3 "IIf's" attached to? They are identical except for the shift number.

    Comment

    • wlc04
      New Member
      • May 2006
      • 70

      #3
      Are you using these calculations in a report like you stated in your original post?

      If so, then you could have a header/footer for the section which lists the detail data for each shift, then put the calculation in the footer (without the identifier (iif([shift])="1" or "2" or "3"). At this point the calculation will be done for each section of the report.

      Comment

      Working...