Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

null count

Hi all,

I  have KPi object

if(today()>duedate,1,0) as DueDateFlag,               -----  this expression in script used.

KPI expression:

ount({<DueDateFlag={1},iD-={'3','4'}>}Number)

here logic is greater than due date  from today values should count   but I have 8 null values it is not counting  so how to include that?

1 Solution

Accepted Solutions
sunny_talwar

Then may be do this

If(Now() > Alt(duedate, Today()-1), 1, 0) as DueDateFlag,

or your DB check should be by truncating the duedate to just date based on your requirement

View solution in original post

15 Replies
YoussefBelloum
Champion
Champion

Hi,

you have null values on which fields ?

soniasweety
Master
Master
Author

due_date field I have null

sunny_talwar

May be try to change your flag to this

If(Today() > Alt(duedate, Today()-1), 1, 0) as DueDateFlag,

YoussefBelloum
Champion
Champion

try to change dueflagdate line on the script to this, and use the same expression:

=if(today()>duedate or len(trim(due_date))=0,1,0) as DueDateFlag

soniasweety
Master
Master
Author

still I can see the result with  2less count

actual 53 in Database and in qlik it is showing 51

dB query :

   select count(number) from Main_Tbl

  where State <> 3 and State <> 4 and GETDATE()>due_date

YoussefBelloum
Champion
Champion

did you try to uncheck all "suppress null values" options and see if these two lines appears ?

sunny_talwar

Can you check what GetDate() is giving

Select GETDATE()

From Dual;

and then see what Today() is giving you in QlikView by creating a text box object with =Date(Today())

Are you getting the same values?

soniasweety
Master
Master
Author

DB result : 2018-04-27 17:31:27.733

qlik : 4/27/2018

sunny_talwar

And due date is not a timestamp, right?