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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to change data during LOAD

Hi

I have two fields in my data as follows:

DateTime
2013.08.2523:00
2013.08.2600:00

Is it possible to change the date and time to the following when time is 00:00 (changes in highlighted in orange)

DateTime
2013.08.2523:00
2013.08.2524:00

Many thanks

Shaun

1 Solution

Accepted Solutions
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Yes, use Previous command..

IF(time(TimeField,'HH:MM')='00:00', Date(Previous(DateField),'YYYY.MM.DD'),DateField) as DateField

View solution in original post

4 Replies
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

have you tried IF statement?

IF(time(TimeField,'HH:MM')='00:00', '24:00',TimeField) as TimeField

IF(time(TimeField,'HH:MM')='00:00', Date(DateField-1,'YYYY.MM.DD'),DateField) as DateField

Not applicable
Author

For the date field, is it possible to take from previous record date rather than minus 1? This is because some dates are Mondays, and I want it to be Friday (i.e. the last record date) rather than Saturday (if using -1).

Thanks for your help!

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Yes, use Previous command..

IF(time(TimeField,'HH:MM')='00:00', Date(Previous(DateField),'YYYY.MM.DD'),DateField) as DateField

Not applicable
Author

Thanks for your help!