is it possible to group by date when I have the date in an unixtimestamp format?
for example in this document:
{
"position_history": {
"1597536000": 109,
"1597546800": 118,
"1597557600": 123,
"1597568400": 124,
"1597579200": 124,
"1597590000": 124,
"1597600800": 130,
"1597611600": 132,
"1597622400": 134,
"1597633200": 137,
"1597644000": 141,
"1597654800": 144,
"1597665600": 145,
"1597676400": 146,
"1597759200": 159,
"1597762800": 159,
"1597766400": 162,
"1597768200": 162,
"1597770000": 162,
"1597771800": 162,
"1597773600": 162,
"1597775400": 170,
"1597777200": 170,
"1597779000": 170,
"1597780800": 170,
"1597782600": 170,
"1597784400": 170,
"1597786200": 170,
"1597788000": 170,
"1597789800": 170,
"1597791600": 170,
"1597793400": 170,
"1597795200": 170,
"1597797000": 172,
"1597800600": 172,
"1597802400": 172,
"1597804200": 172,
"1597806000": 172,
"1597807800": 173,
"1597809600": 173,
"1597811400": 173,
"1597813200": 173,
"1597815000": 173,
"1597816800": 173,
"1597818600": 173,
"1597820400": 164,
"1597822200": 164,
"1597824000": 164,
"1597825800": 164,
"1597827600": 164,
"1597833000": 162,
"1597834800": 162,
"1597836600": 162,
"1597838400": 162,
"1597840200": 144,
"1597842000": 144,
"1597843800": 144,
"1597845600": 144,
"1597847400": 144,
"1597849200": 144,
"1597851000": 142,
"1597852800": 142,
"1597854600": 142,
"1597856400": 142,
"1597858200": 142,
"1597860000": 142,
"1597861800": 147,
"1597863600": 147,
"1597883400": 153,
"1597885200": 153,
"1597887000": 153,
"1597888800": 153,
"1597890600": 153,
"1597892400": 153,
"1597894200": 167,
"1597896000": 167,
"1597897800": 167,
"1597899600": 167,
"1597901400": 167,
"1597903200": 167,
"1597905000": 170,
"1597906800": 170,
"1597908600": 170,
"1597910400": 170,
"1597912200": 170,
"1597914000": 170,
"1597917600": 172,
"1597919400": 172,
"1597921200": 172,
"1597923000": 172,
"1597924800": 172,
"1597926600": 172,
"1597928400": 171,
"1597930200": 171,
"1597932000": 171,
"1597933800": 171,
"1597935600": 171,
"1597937400": 171,
"1597941000": 177,
"1597942800": 177,
"1597944600": 177
}
}
the field/key is the unix timestamp and the value is a position in a top.
Would it be possible to group by day/week/year (based on the timestamps) and do the average on the value?
in mysql you could do something like:
SELECT
AVG(something
) AS 12
FROM
table
WHERE
something
GROUP BY
DAY/WEEK/YEAR(
FROM_UNIXTIME(date
, ā%Y-%m-%d %H.%i.%sā)
)