I have a problem with data from Google Analytics 4. I have a total time duration metric and its in BQ but as integer. I need to change it TIME since im using the data in PowerBi. Any ideas?
I tried all the solutions in the internet - none of them is working. I tried to transform the data in PowerBi - but it didn't work.
Your question is not clear as to what the value of integer is. It could be
Assuming case 1: Use PARSE_DATE with following parse string indicating %Y year, %m month, %d date
Result: 2024-01-17
Assuming case 2: Use PARSE_TIME with following parse string indicating %I Hours %M Minutes, %S seconds
Result: 11:30:00
Case 3: Use
Result: 2024-01-17 01:01:10 UTC
Case 4: You need to know from when the time is being counted. and convert that seconds/minutes into days and add to that base date.
Find Documentation here PARSE_TIMESTAMP , PARSE_DATE, PARSE_TIME