Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
aaronnayan
Creator III
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
aaronnayan
Creator III
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)

View solution in original post

10 Replies
jmvilaplanap
Specialist
Specialist

Hi, Try with this

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

vishsaggi
Champion III
Champion III

Try this:

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

Anonymous
Not applicable

try

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

Chernov
Creator
Creator

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


-= : mean NOT

'*' : mean All values

aaronnayan
Creator III
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' ?

effinty2112
Master
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.

vishsaggi
Champion III
Champion III

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