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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
josephinetedesc
Creator III
Creator III

date problems and arithmetic values


Hi my problem is that I have date 0 in Crystal reports coming in as 01/01/1800

Qlikview is recognising the date:

so in Qlikview the dates look like this:

timestamp1.JPG

my formula is:

if(time4-time3 <0, 0, time4-time3)

if I do not use an if statment I get this: the same result

timestamp2.JPG

I end up with problems when tryting to add the column Time4-time3 in qlikview but not in Excel

Patientlocationtime4-time3Timestamp(time4)timestamp(time3)
1AREA a0.011/11/2015 4:45:02 PM11/11/2015 4:44:04 PM
2AREA a1.912/11/2015 9:27:54 AM10/11/2015 11:24:14 AM
3AREA a0.0##########################################
4AREA a5.712/11/2015 9:58:09 AM6/11/2015 4:03:56 PM
5AREA a0.0####################11/11/2015 2:42:55 PM
6AREA a---
7AREA a0.0####################11/11/2015 9:39:07 AM
8AREA a4.113/11/2015 12:33:32 PM9/11/2015 10:32:21 AM
9AREA a0.0####################13/11/2015 1:27:37 PM
10AREA a0.0####################13/11/2015 3:32:57 PM
11AREA a0.0##########################################
12AREA a---
13AREA a0.0####################12/11/2015 2:28:54 PM
14AREA a0.010/11/2015 3:40:20 PM10/11/2015 3:21:51 PM
15AREA a0.0##########################################
16AREA a0.0##########################################
17AREA a---
18AREA a0.0##########################################
19AREA a0.0####################9/11/2015 2:16:07 PM
20AREA a1.911/11/2015 3:06:41 PM9/11/2015 5:17:50 PM
21AREA a0.0####################11/11/2015 9:04:14 AM
22AREA a0.0##########################################
23AREA a---
average0.7
sum13.7
count19
average0.719567495

My other problem is that when I remove the Patient dimension - I get no data?  I do not understand why.  I am sure there is a reason ...

What do I need to do in Qlikview to get the aritmetic values?

Jo

4 Replies
swuehl
MVP
MVP

What is your data source you are using in QV? I think it would be best to already correct the data when reading in.

Could you post some sample data records? And the expected result?

josephinetedesc
Creator III
Creator III
Author

would like something like this:  those rows with all hash not to be counted ..  They are not counted because either timestamp 3 or timestamp 4 has a value of -35617 - ie nothing has been done yet.

    

Patientlocationtime4-time3Timestamp(time4)timestamp(time3)
1AREA a0.011/11/2015 4:45:02 PM11/11/2015 4:44:04 PM
2AREA a1.912/11/2015 9:27:54 AM10/11/2015 11:24:14 AM
3AREA a0.0########################################
4AREA a5.712/11/2015 9:58:09 AM6/11/2015 4:03:56 PM
5AREA a0.0##################11/11/2015 2:42:55 PM
6AREA a---
7AREA a0.0##################11/11/2015 9:39:07 AM
8AREA a4.113/11/2015 12:33:32 PM9/11/2015 10:32:21 AM
9AREA a0.0##################13/11/2015 1:27:37 PM
10AREA a0.0##################13/11/2015 3:32:57 PM
11AREA a0.0########################################
12AREA a---
13AREA a0.0##################12/11/2015 2:28:54 PM
14AREA a0.010/11/2015 3:40:20 PM10/11/2015 3:21:51 PM
15AREA a0.0########################################
16AREA a0.0########################################
17AREA a---
18AREA a0.0########################################
19AREA a0.0##################9/11/2015 2:16:07 PM
20AREA a1.911/11/2015 3:06:41 PM9/11/2015 5:17:50 PM
21AREA a0.0##################11/11/2015 9:04:14 AM
22AREA a0.0########################################
23AREA a---
average0.7
sum13.7
count6
average2.278630401
swuehl
MVP
MVP

Ok, but these are not your input records, right? How do these look like?

Maybe it's enough to do something like

LOAD

     Patient,

     location,

     if(time3 >0, time3, NULL() ) as time3,

     if(time4 >0, time4, NULL() ) as time4,

     ...

FROM ...;

This should only take time stamps after Dec 30 1899 into acount.

josephinetedesc
Creator III
Creator III
Author

so would i do a resident load for this?  I would still like to see ALL patients.

I will see what I can do at work tomorrow.

Thank you will let you know