Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

aksharma
New Contributor

How to combine 2 rows into one

Hello,

I have below table

  

Order#Status
1Booked
1

Order Hold

And I want to convert above into below table

  

Order#

Status
1Hold

Thanks in Advance.

3 Replies
sasiparupudi1
Honored Contributor III

Re: How to combine 2 rows into one

is there id value for HOLD also?

Order#Status
1Booked

1

1

Order

Hold

or

Order#Status
1Booked
1

Order Hold

?

aksharma
New Contributor

Re: How to combine 2 rows into one

Hi Sasidhar,

What I want to do is . If the id 1 has value booked and order_hold both .

I want to assign a new value as ''HOLD" .

And consider only one row instead of 2.

sasiparupudi1
Honored Contributor III

Re: How to combine 2 rows into one

In a chart May be like if(Index(Aggr(Concat(Status,','),ID),'Booked')>0 And (Index(Aggr(Concat(Status,','),ID),'order_hold')>0,'HOLD')

if you want to do it in the script level, try like below

Left Join(your Table)

Load

ID,

Concat(Status,','),ID), ConcatenatedStatus

Your Table

;

Final:

Noconcatenate Load *,

if(wildmatch(ConcatenatedStatus,'order_hold'),'Booked')>0,'HOLD') As NewStatus

Resident Your Table

;

Drop Your Table