locked
IF Expression In Select Expert RRS feed

  • Question

  • User729265059 posted

    Hi All,

    I am currently writing a crystal report but have hit a bit of a brick wall and I'm hoping someone will be able to help me.
     
    In brief what I am trying to do is:
     
    The table I am looking at is for Estimates we create and for 1 estimate it can have upto 5 components
     
    EG: Est 1 - Comp 1, Comp 2, Comp 3, Comp 4 and Comp 5
     
    What I want to see is the first available Component per estimate. Unfortunately it is not as simple are as {Comp}= "Comp 1" because our estimators are able to delete "Comp 1", making "Comp 2" the first component.
     
    What I need is something along the lines of:
     
    If Comp 1 is the first compent hide the rest else
    if Comp 2 is the first compent hide the rest
     
    Have tried:
     
    if {Comp}="Comp 1" then {Comp}="Comp 1" else
    if {Comp}="Comp 2" then {Comp}="Comp 2" else
    ...
     
    Any help you can give would be much appreciated.
     
    Thank you Smile
    Wednesday, May 30, 2012 5:31 AM

Answers

  • User729265059 posted

    I have worked it out now.

     The solution lay in the "Suppression" function in "Section Expert" not the "Select Expert".
     
    I assigned a Value to each Comp possibility
    IE: Comp1 = 1 , Comp2 = 2 etc.
     
    Did a summary by esimate to show the Minimum Value so if Comp1 wasn't there the min value would be 2 and so on.
     
    Then in Section Expert / Detail / Suppress I put in the formula:
     
    if {@comp}=Minimum ({@comp}, {Estimate-ID}) then false else true
     
    This supressed all the higher values and left me with the first component for each estimate.
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 30, 2012 6:19 AM