2 Replies Latest reply on Jul 18, 2017 5:49 AM by Jim Dehner

    Calculated Field Help

    Daniel Nevitt

      Hi,

       

      I would really appreciate some help with the below expression.  I am trying to create a calculated field that only counts if the buy count and sell count are greater than 0.

       

      COUNT(IF([Side]='Buy'>0 and [Side]='Sell'>0)

      then Count([Side])

      END

       

      Thanks,

      Daniel

        • 1. Re: Calculated Field Help
          T G

          Why you are not trying COUNT([Side]). If there is anything else, please share the workbook.

          • 2. Re: Calculated Field Help
            Jim Dehner

            Hi David - I agree that it would be easier to understand it we could see your workbook - that said the formula has a couple of issues

             

            COUNT(IF([Side]='Buy'>0 and [Side]='Sell'>0)

            then Count([Side])

            END

             

             

            In the first line Side = cannot at the same time (record) have a value of Buy and a value of Sell - so all records will fail the If check

             

            If you are trying to eliminate records that don'f have either but>0 or sell>0 the formula would be

             

            IF([Side]='Buy'>0  Or [Side]='Sell'>0)  then 1 else 0 end

             

            then you would aggregate the formula as a sum when yo place it on the viz

             

            Let me know if this helps

            Jim