Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
n1ef5ng1
Creator
Creator

This timestamp field is strange

Hi everyone,

Please see attached to understand more about this data column call Date. I am unable to change anything from data point of view as it is scrap totally from website.

Date as Timestamp,

     Date(floor(timestamp#(Date,'MM/DD/YYYY hh:mm')),'DD/MM/YYYY') as Date,

    hour(Timestamp#(Date,'MM/DD/YYYY hh:mm')) as Hour

Basically the raw data is timestamp,

however for conversion of timestamp to date and hour, I somehow cant get the first twelve days of the month for this timestamp. Anybody can help me on this? thanks in advance

11 Replies
tresesco
MVP
MVP

Try like:

LOAD

      Date as Timestamp,

      Date(floor(Alt(Date,timestamp#(Date,'MM/DD/YYYY hh:mm'))),'DD/MM/YYYY') as Date,

      hour(Alt(Date,Timestamp#(Date,'MM/DD/YYYY hh:mm'))) as Hour

ganeshsvm
Creator II
Creator II

Hi Ben,

Can you provide some sample data, your qvw has only script.

we need your data format to provide solution.

Regards,

Ganesh

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

I would do as tresesco suggests but also will reduce data in Hour field like:

LOAD @1 as [Original Date]

       ,Date(Floor(Alt(@1,timestamp#(@1,'MM/DD/YYYY hh:mm'))),'DD/MM/YYYY') as Date

       ,hour(Floor(Alt(@1,Timestamp#(@1,'MM/DD/YYYY hh:mm')), 1/24)) as Hour

FROM

(biff, no labels, table is Sheet1$);

n1ef5ng1
Creator
Creator
Author

Attached is the dataset, thanks

tresesco
MVP
MVP

PFA

tresesco
MVP
MVP

Hi,

     Hour() is not a formatting function. It actually returns an integer that represents hour. Hence the flooring would not be required here.

n1ef5ng1
Creator
Creator
Author

Second of Jan to 12 of jan doesnt work. this is whole of Jan data. somehow it shows feb 01 mar 01 instead of jan 2nd and jan 3rd

tresesco
MVP
MVP

I don't get anything such in your sample data.

n1ef5ng1
Creator
Creator
Author

I think   Qlikview is confuse with DD/MM and MM/DD on the first 12 days where they assume is month. see screenshot below. all these dates are Janaury so expected output shoulld be Jan 1st to Jan 31st