Announcements
cancel
Showing results for
Did you mean:
Creator III

## simple set anlaysis with WHERE clause

Hi guys i need help with some set analysis

I want to =SUM(FUEL_MILES) where DRIVER is NULL

Fields:

FUEL_MILES

DRIVER

1 Solution

Accepted Solutions
Creator III
Author

Thankyou guys

For the help

Originaly it was Null in text

I made a change in the script so it would be easier in the future=    IF(DRIVER>0,1,0) AS JO_DRIVER,

SUM( { < JO_HasDriver={0} > } FUEL_MILES)

10 Replies
Specialist

Hi, Try with this

sum({<Driver={''}>}FUEL_MILES)

Champion III

Try this:

= SUM({< DRIVER = {"= Len(Trim(DRIVER)) = 0 "} >} FUEL_MILES)

Anonymous
Not applicable

try

sum({\$-<DRIVER={"*"}>} [FUEL_MILES9])

Creator

SUM( { < DRIVER -={'*'} > }  FUEL_MILES)

-= : mean NOT

'*' : mean All values

Creator III
Author

I want this set analysis to calculate FUEL_MILES when there is no driver. (NULL)

Anonymous
Not applicable

I think that won't work. You'll get the empty set.

Anonymous
Not applicable

is your "NULL" null() or 'null' ?

Master

Hi Aaron,

Maybe:

=sum(FUEL_MILES)-sum({\$<Driver={"*"}>}FUEL_MILES)

Cheers

Andrew

Edit : Robin has written his expression in a far better way than mine. I think my formulation is easy to understand but once you do understand what's going on Robin's expression should be used.

Champion III

Did you try any of the expressions suggested? How is your null represented? Like actual word Null or '-' hyphen?

Community Browser