Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
stonecold111
Creator III
Creator III

Concat in qliksense

Hi qlikss,

I have table like this.

I'd.        Letter.         Name

1.           A.                  Jhon

1.           B.                    Kane

1.            A.                     Taker

2.            B.                 Rock

2               B.                Punk

3.               A.               Myster

I want my output table like this

I'd.        Final column

1.          Jhon,Taker

2.          Rock,Punk

3.          Myster

 

Whenever there is A , it should concatenate all A values. If there no " A" for that particular I'd then it 

Should concatenate all "B" values.

Labels (1)
1 Solution

Accepted Solutions
rwunderlich

The exact order of operations kind of depends on where you are doing this, but here's a script suggestion.

Data:
LOAD
Id,
Letter,
Concat(Name, ',') as Name
Group By Id, Letter
;
LOAD * Inline [

Id, Letter, Name
1, A, Jhon
1, B, Kane
1, A, Taker
2, B, Rock
2, B, Punk
3, A, Myster
]
;

Inner Join (Data)
LOAD
Id,
MinString(Letter) as Letter
Resident Data
Group By Id
; 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

4 Replies
stonecold111
Creator III
Creator III
Author

@QFabian 

 

rwunderlich

The exact order of operations kind of depends on where you are doing this, but here's a script suggestion.

Data:
LOAD
Id,
Letter,
Concat(Name, ',') as Name
Group By Id, Letter
;
LOAD * Inline [

Id, Letter, Name
1, A, Jhon
1, B, Kane
1, A, Taker
2, B, Rock
2, B, Punk
3, A, Myster
]
;

Inner Join (Data)
LOAD
Id,
MinString(Letter) as Letter
Resident Data
Group By Id
; 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

mato32188
Specialist
Specialist

Hi @stonecold111,

fully agree with @rwunderlich's solution. If you want keep value order of concatenated string same as in your output table (Rock, Punk), just a small adjustment of mentioned solution:

Data:
LOAD
Id,
Letter,
Concat(Name, ',',Sorter) as Name
Group By Id, Letter
;

LOAD
Id,
Letter,
RecNo() as Sorter,
Name
;
LOAD * Inline [
Id, Letter, Name
1, A, Jhon
1, B, Kane
1, A, Taker
2, B, Rock
2, B, Punk
3, A, Myster
]
;

Inner Join (Data)
LOAD
Id,
MinString(Letter) as Letter
Resident Data
Group By Id
;

BR

m

 

ECG line chart is the most important visualization in your life.
stonecold111
Creator III
Creator III
Author

You guys are awesome.

Thanks both of you