Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Qlik QREP Exam - Topic 2 Question 43 Discussion

Posted by Cherry on Sep 30, 2026 at 01:57 AM

Using Qlik Replicate, how can the timestamp shown be converted to unlx time (unix epoch - number of seconds since January 1st 1970)?

Suggested Answer: D

The goal is to convert a timestamp to Unix time (seconds since January 1, 1970).

The strftime function is used to format date and time values.

To get the Unix epoch time, you can use the command: strftime('%s',SAR_H_COMMIT_TIMESTAMP) - strftime('%s','1970-01-01 00:00:00').

This command extracts the Unix time from the timestamp and subtracts the Unix epoch start time to get the number of seconds since January 1, 1970. This is consistent with the Qlik Replicate documentation and SQL standard functions for handling date and time conversions.

To convert a timestamp to Unix time (also known as Unix epoch time), which is the number of seconds since January 1st, 1970, you can use the strftime function with the %s format specifier in Qlik Replicate. The correct syntax for this conversion is:

strftime('%s', SAR_H_COMMIT_TIMESTAMP) - strftime('%s','1970-01-01 00:00:00')

This function will return the number of seconds between the SAR_H_COMMIT_TIMESTAMP and the Unix epoch start date. Here's a breakdown of the function:

strftime('%s', SAR_H_COMMIT_TIMESTAMP) converts the SAR_H_COMMIT_TIMESTAMP to Unix time.

strftime('%s','1970-01-01 00:00:00') gives the Unix time for the epoch start date, which is 0.

Subtracting the second part from the first part is not necessary in this case because the Unix epoch time is defined as the time since 1970-01-01 00:00:00. However, if the timestamp is in a different time zone or format, adjustments may be needed.

The other options provided do not correctly represent the conversion to Unix time:

Options A and B use datetime instead of strftime, which is not the correct function for this operation1.

Option C incorrectly includes <code>datetime.datetime</code>, which is not a valid function in Qlik Replicate and seems to be a mix of Python code and SQL1.

Option E uses Time.now.strftime, which appears to be Ruby code and is not applicable in the context of Qlik Replicate1.

Therefore, the verified answer is D, as it correctly uses the strftime function to convert a timestamp to Unix time in Qlik Replicate1.


Get Premium QREP Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
9 comments · newest first
TO
Tonette 5 days ago
Totally agree with B, it’s straightforward!
TA
Tawanna 10 days ago
Wait, is E even a valid option? Sounds weird.
GE
Georgiann 15 days ago
C seems off, not sure about that syntax.
MI
Miles 20 days ago
I think A is the right choice, though.
SA
Sanjuana 26 days ago
Option B looks correct for converting to unix time.
JA
Jacklyn 1 month ago
I don’t think option E is correct because it looks like it’s using Ruby syntax instead of SQL. That one stands out as definitely wrong.
LY
Lynette 1 month ago
I’m a bit confused about the syntax in option D. I remember using strftime, but I can't recall if the quotes and commas are in the right places.
AU
Audrie 1 month ago
I practiced a similar question where we had to convert timestamps, and I feel like option B looks familiar. It might be the right format for what we need.
EU
Eulah 2 months ago
I think I remember something about converting timestamps in SQL, but I'm not sure if it's using 'unixepoch' or 'localtime' correctly in the options.
0/2000 characters

Save Cancel