Jump to content
  • 0

Case Statement for finding records that are between two numbers


Hiperf

Question

I need to flag records that are either 15% or 30%. The first WHEN argument works, but the will not verify when the second argument is added. Error "near ("

CASE 
WHEN SUM([@calcfield:4])/AVG([@calcfield:7]) <=.015 THEN '15%'
WHEN SUM([@calcfield:4])/AVG([@calcfield:7]) <=.03  AND >=.016 THEN '30%'

ELSE ''
END

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

Hello @Hiperf,

As I understand, you use this formula in Totals & Aggregations.

It looks like one condition is missing.

Please test this one:

CASE 
WHEN SUM([@calcfield:4])/AVG([@calcfield:7]) <=.015 THEN '15%'
WHEN SUM([@calcfield:4])/AVG([@calcfield:7]) <=.03  AND SUM([@calcfield:4])/AVG([@calcfield:7]) >=.016 THEN '30%'

ELSE ''
END

Hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...