Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist II
Specialist II

Order By with Concat method

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:

image.png

 

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:

image.png

 

 

Labels (1)
1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Order By with Concat method

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

View solution in original post

2 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Order By with Concat method

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

View solution in original post

Highlighted
Specialist II
Specialist II

Re: Order By with Concat method

Great!!! 

That work perfectly, I didn't notice about this 3 parameter. - Concat ([ distinct ] string [, delimiter [, sort-weight]])

 

Thank you