Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Concat values from one field

Hi,

I'm facing a problem with concat few values from one field.

EX: I have two column called State,Value and those values are like...

State,Value

A,10

B,5

C,12

D,8

I want

State,Value

A/B,15

C/D,20

Can any one please tell me how to get this done.

Thanks in Advance.

Regards,

Arjun

10 Replies
Highlighted

Re: Concat values from one field

What is the logic behind combining 1st 2 together and next 2 together? Is there another dimension based on which you want to combine them?

Highlighted

Re: Concat values from one field

May be like this:

Table:

LOAD * INLINE [

Dim, State Value

1, A, 10

1, B, 5

2, C, 12

2, D, 8

];

FinalTable:

NoConcatenate

LOAD Dim,

          Concat(State, '/') as State,

          Sum(Value) as Value

Reisdent Table

Group By Dim;

Drop Table Table;

Highlighted
Not applicable

Re: Concat values from one field

Hi Sunny,

There is no logic behind doing this, need to combine few dimension values.

I'm not sure how to do this.

Highlighted
MVP
MVP

Re: Concat values from one field

you should have data like this, then only you will be able to use the concat

Data:

LOAD * inline [

ID,State,Value

1,A,10

1,B,5

2,C,12

2,D,8 ];

New:

noconcatenate

LOAD ID,

          Concat(distinct State,'/') as State,

          sum(Value) as Value

resident Data

group by ID;

drop table Data;

Highlighted

Re: Concat values from one field

Need some basis to know what will be combined into groups, right? How else will you do it in your scenario?

Highlighted

Re: Concat values from one field

Drop Table Data you mean

Highlighted
MVP
MVP

Re: Concat values from one field

Yes, bhavnao ko samjo

Highlighted

Re: Concat values from one field

samjh gaya

Highlighted

Re: Concat values from one field

Kushal, I have one question.. What is the difference between your code and Sunny Code. Could you please elaborate that. Because, Sunny code is fine for that Issue....

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)