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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
harsha087
Contributor III
Contributor III

timestamp to num conversion

Hi ,

while converting the timestamp  to  num its giving incorrect number as shown below 

 

harsha087_0-1630649890438.png

Actual values for

26/04 - 44312

29/04 - 44315

kindly help me ..

 

1 Solution

Accepted Solutions
tresB
Champion III
Champion III

What if you try like:

Interval(lastmodifieddate -createdbydate, 'D')

View solution in original post

8 Replies
tresB
Champion III
Champion III

If you don't need the fraction value for the timestamp, try like:

Num(Floor(createdbydate)) as numcreate

harsha087
Contributor III
Contributor III
Author

hi sir,

 

i have written same logic .. but still i am getting in correct num . 

same as the screenshot given above .. 

harsha087
Contributor III
Contributor III
Author

when i write the same logic in the table chart as dimension i am getting correct numbers .. 

second column as a calculated dimension 

3rd columns .. same logic in script level

 

harsha087_0-1630651772802.png

 

tresB
Champion III
Champion III

Are you using any formatting function in script?

harsha087
Contributor III
Contributor III
Author

Date(Floor(createdbydate), 'MM/DD/YYYY') AS [CREATED_DT]

harsha087
Contributor III
Contributor III
Author

Actually my requirement is to get days between two days . But unfortunately, i was not able get the days incorrect due to create date into conversion in scripting level .

harsha087_0-1630659295455.png

 

to get difference between two dates , i have written below logic

Ceil(Interval(Date(lastmodifieddate, 'DD/MM/YYYY hh:mm') - Date(createdbydate, 'DD/MM/YYYY hh:mm'), 'DD' ))

 

tresB
Champion III
Champion III

What if you try like:

Interval(lastmodifieddate -createdbydate, 'D')

MarcoWedel
MVP
MVP

your screenshot looks like there is each combination of field values generated in this table suggesting that there is an issue in your data model rather than a simple timestamp to integer conversion issue.

Can you check again how your numcreate field is generated?
Maybe it is in a different (island) table, the key fields are not properly generated or the numcreate field is not properly joined to the table that contains createdbydate ?

hope this helps

regards

Marco