Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Not applicable

Hour

Hi,

I have date format like this " 23-03-2016 18:20:20". My requirement is to show in hours. How to show in Hour format?

Thanks

Tags (1)
1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Hour

Hi,

If you want this in script try like this

LOAD

*,

TimeStamp(TimeStamp#(Left(TimeFieldName, 13), 'DD-MM-YYYY hh')) AS Date_Hour

FROM DataSource;

Regards,

Jagan.

View solution in original post

7 Replies
Highlighted
Chanty4u
Esteemed Contributor III

Re: Hour

=Hour(ur field)

Highlighted
Chanty4u
Esteemed Contributor III

Re: Hour

or else u want with date also

Date(Datefield) & ' - ' & Hour(Datefield)

Highlighted
Chanty4u
Esteemed Contributor III

Re: Hour

try this

=Time(Frac(Datefield, 'hh')

Highlighted

Re: Hour

Hi,

Try,

=Hour(Date#('23-03-2016 18:20:20','DD-MM-YYYY hh:mm:ss'))

Load *,

Hour(Date#(FieldName,'DD-MM-YYYY hh:mm:ss')) & ' Hours' as Hour

From Source

Highlighted
Not applicable

Re: Hour

Hi Jack,

Your requirement is not clear.

If you want to take hours out of your date field then you can use : hour(DateField)

If you want hours between today and your date field then you can use Interval function like:

=Interval(Date(Today(),'DD-MM-YYYY hh:mm:ss') - Date(Date#(DateField,'DD-MM-YYYY hh:mm:ss'),'DD-MM-YYYY hh:mm:ss'),'hh')

Please see : Today with timestamp will return : 31-03-2016 00:00:00

If you want exact time of now, you can use now() instead of Today()

Regards,

Anjali Gupta

Highlighted
MVP & Luminary
MVP & Luminary

Re: Hour

Hi,

Try like this

TimeStamp(TimeStamp#(Left('23-03-2016 18:20:20', 13), 'DD-MM-YYYY hh'))

Regards,

Jagan.

Highlighted
MVP & Luminary
MVP & Luminary

Re: Hour

Hi,

If you want this in script try like this

LOAD

*,

TimeStamp(TimeStamp#(Left(TimeFieldName, 13), 'DD-MM-YYYY hh')) AS Date_Hour

FROM DataSource;

Regards,

Jagan.

View solution in original post