Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to concat some rows into one, but I need to be order by date and for some reason that's not working.
Input:
Aux_Comentario:
LOAD
DISTINCT
ID_INSTALACAO,
"text" as Texto,
Date(Date#('19700101', 'YYYYMMDD') + (time / 86400)) AS time
FROM [lib://Dados\Light P&D\cas_br_cuc\Analise\Google\Place\PlaceStatus.qvd](qvd)
WHERE LEN(text)>0
;
NoConcatenate Aux_Comentario2:
load *, AutoNumber(ID_INSTALACAO&time,ID_INSTALACAO) as key Resident Aux_Comentario
order by ID_INSTALACAO,time DESC;
DROP TABLE Aux_Comentario;
NoConcatenate
Comentario:
load
ID_INSTALACAO,
Concat(time&': '&Texto,Chr(10)) as Texto_Concat
Resident
Aux_Comentario2
WHERE key<=3 and len(Texto)>0
Group by ID_INSTALACAO
order by key DESC
;
DROP TABLE Aux_Comentario2;
output:
I think you need to enable the sorting within the concat() which could be done within the third parameter, maybe with something like this:
...
Concat(time&': '&Texto,Chr(10), -key) as Texto_Concat
...
- Marcus
I think you need to enable the sorting within the concat() which could be done within the third parameter, maybe with something like this:
...
Concat(time&': '&Texto,Chr(10), -key) as Texto_Concat
...
- Marcus
Great!!!
That work perfectly, I didn't notice about this 3 parameter. - Concat ([ distinct ] string [, delimiter [, sort-weight]])
Thank you