Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate field with null

I have two column that use these formula:

=sum({<[Code Type]={'Code V'},Detail={'Operation Activities'}>}HourSpent)

=sum({<[Code Type]={'Code V'},Detail={'Project'}>}HourSpent)

What formula should i use to get:

- code type is code v

- detail is null

TQ

6 Replies
Anonymous
Not applicable
Author

=sum({<[Code Type]={'Code V'},Detail={"=isnull(Detail)"}>}HourSpent)

Anonymous
Not applicable
Author

can't calculate.not sure why. what if calculate all code v except code v with detail project & operation activities?

Anonymous
Not applicable
Author

Hi,

Yes, you can even do that if you have only "project" & "operation activities" in detail column. You may use below script.

Sum({<[Code Type]={'Code V'},Detail-={'Operation Activities', 'Project'}>} HourSpent)


PS: Added "-" after Detail field to exclude 'Operation Activities' and 'Project'

nirav_bhimani
Partner - Specialist
Partner - Specialist

Create a flag in the script

eg. if(len(Detail)=0,1,0)as FlagDetailNull

Then use this flag in the set analysis.

Regards,

Nirav Bhimani

ashfaq_haseeb
Champion III
Champion III

Hi

Filtering Null is a tricky part.

You can try {*} to select all values that should exclude the null value and - {''} should get rid of the blank values.

=sum({<[Code Type]={'Code V'},Detail={'*'}-{''}>}HourSpent)

Regards

ASHFAQ

er_mohit
Master II
Master II

Try this

=sum({<[Code Type]={'Code V'},Detail-={'*'}>}HourSpent)


or this

=sum({<[Code Type]={'Code V'},Detail={''}>}HourSpent)

or this

=sum({<[Code Type]={'Code V'},Detail={' '}>}HourSpent)