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

Time Condition

I have time

Start time     endtime

08:25.32         -

10:35:12      12:26:35

i want to show if there is no endtime they have not logged out

if(EndTime='Null','Dint Loggedout','Loggedout')

in database there are many null values in endtime

1 Solution

Accepted Solutions
qlikviewwizard
Master II
Master II

Hi Gowtham,

Use the any script:

Data1:

load *, If(Len(Trim(end_time))=0,'Dint Loggedout','Loggedout') as Status;

LOAD timestamp(Start_time) as Start_time,timestamp(end_time) as end_time  Inline [

Start_time,end_time

08:25.32,

10:35:12,12:26:35

];

Data2:

Load Starttime,endtime,If(IsNull(endtime) or Len(endtime)<=1,'Dint Loggedout','Logged Out') as Status;

LOAD * Inline [

Starttime,endtime

08:25.32 ,  

10:35:12 ,12:26:35];

Capture.PNG

Capture1.PNG

View solution in original post

8 Replies
stigchel
Partner - Master
Partner - Master

try with

If(Len(Trim(endtime))=0,'Dint Loggedout','Loggedout')

gautik92
Specialist III
Specialist III
Author

dint work

qlikmsg4u
Specialist
Specialist

Load Starttime,endtime,If(IsNull(endtime) or Len(endtime)<=1,'Dint Loggedout','Logged Out') as Status;

LOAD * Inline [

Starttime,    endtime

08:25.32 ,      

10:35:12 ,     12:26:35

sunilkumarqv
Specialist II
Specialist II

Try this

IF(Isnull(endtime) or Len(endtime)<=0,'Didnt Logged out','Logged out')

ganeshreddy
Creator III
Creator III

Hi Gowtham,

Try this

If (EndTime=null(),'Log out Error','Logged out') as EndTimeDisc,

or you can create a flag for further complex caliculations as

If (EndTime=null(),1,0) as Logout_Flag ,

However you need to check , they are actual null values or is there any spaces involved to try above expressions,

I hope this hepls,

Best regards,

Ganesh.

sasiparupudi1
Master III
Master III

Try

If(KeepChar(endtime,'0123456789')='','Dint Loggedout','Logged Out') as Status;

gautik92
Specialist III
Specialist III
Author

dint work

qlikviewwizard
Master II
Master II

Hi Gowtham,

Use the any script:

Data1:

load *, If(Len(Trim(end_time))=0,'Dint Loggedout','Loggedout') as Status;

LOAD timestamp(Start_time) as Start_time,timestamp(end_time) as end_time  Inline [

Start_time,end_time

08:25.32,

10:35:12,12:26:35

];

Data2:

Load Starttime,endtime,If(IsNull(endtime) or Len(endtime)<=1,'Dint Loggedout','Logged Out') as Status;

LOAD * Inline [

Starttime,endtime

08:25.32 ,  

10:35:12 ,12:26:35];

Capture.PNG

Capture1.PNG