Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to bring 5 rows to 2 rows

Hi all,

Maybe a bit of a strange question, but I really need to have this

In QlikView I have the following data:

CUSTOMERORDERID
Customer X15154
Customer X21644
Customer X22564
Customer X22578
Customer X54650

I need to make a straight table with the name | address | zip | city. In case that a customer has more then one ORDERID, I need to see the specific customer two times, or in other words two lines with the same data. The outcome of the example data above needs to be like this:

CUSTOMERADDRESSZIPCODECITY
Customer XAddress customer XZipcode customer XCity customer X
Customer XAddress customer XZipcode customer XCity customer X

It doesn´t matter where I solve this: it can be in the script as well as in an expression. I'am thinking about flagging and counting, but untill now I can't get it done. I hope some of you can help me out.

Cheers,

Henco

1 Solution

Accepted Solutions
Not applicable
Author

Please take a look at the attached QVW.

View solution in original post

5 Replies
Not applicable
Author

Please take a look at the attached QVW.

Anonymous
Not applicable
Author

Thanks for your help. Now I need to translate this to my own situation, I think that is going to work. One thing I forgot to mention is that it needs to work per orderdate, but I think I can do that.

Thanks again.

Cheers,

Henco

Anonymous
Not applicable
Author

Hi,

I made it as you said, so far so good. Thanks again.

As I said, I forgot to mention that I need to deal with orderdates. So I need to see this per orderdate. Could you please explain to me how I need to do that?

So, the inline data will look like this:

[Orders]:

LOAD

          CUSTOMER,

          ORDERID,

          Date

INLINE

[

          CUSTOMER,          ORDERID, Date

          Customer X,          15154, 15-02-2012

          Customer X,          21644, 15-02-2012

          Customer X,          22564, 18-03-2012

          Customer X,          22578, 18-03-2012

          Customer X,          54650, 18-03-2012

          Customer A, 12345, 12-03-2012

          Customer A, 15648, 15-03-2012

          Customer B, 99999, 15-08-2012

          Customer B, 88888, 15-08-2012

];.

The result should be:

Customer X on two rows for 15-02-2012

Customer X on two rows for 18-03-2012

Customer A on one row for 12-03-2012

Customer A on one row for 15-03-2012

Cusomter B on two rows for 15-08-2012

Thanks in advance!

Cheers,
Henco

Anonymous
Not applicable
Author

There is no answer needed anymore. I fixed it by using Customer_Date as an ID.

Cheers,

Henco

senpradip007
Specialist III
Specialist III

Hi hencovanee,

Please take a look at the attached QVW.