Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
fedcas
New Contributor III

How Trasform Row in Column???

Hi all!

I have a big problem!

I'm loading a crm table where there are different contacts (Sales Manager, Edp Manager, etc) for the each customer.

I have to obtai a unique row for any Customer code with all contact.

Example:

Table A:

CustomerContactTypeEmal
abc ltdmr Coopercfocooper@abc.com
abc ltdmr Laivesciolaives@abc.com
gold ltdmrs Bluesedpblues@gold.com
gold ltdmrs Greenciogreen@gold.com
gold ltdmrs Blackcfoblack@gold.com


New Table:

CustomerContact1Type1Emal1Contact2Type2Emal2Contact3Type3Emal3
abc ltdmr Coopercfocooper@abc.commr Laivesciolaives@abc.com
gold ltdmrs Bluesedpblues@gold.commrs Greenciogreen@gold.commrs Blackcfoblack@gold.com


Every suggestion will be appreciate!!!!

Thanks!!!

1 Solution

Accepted Solutions
Not applicable

How Trasform Row in Column???

Agree with Karl but sometimes there is exceptions really :-)

If you really want to make it this way you may have a look at "generic load". See the link bellow for more info

http://qlikviewnotes.blogspot.com/2010/05/use-cases-for-generic-load.html

9 Replies
Luminary
Luminary

How Trasform Row in Column???

Do you want to see the new table in the GUI or in the data model?

And if you want it this way in the data model, why do you want to do something like this? Usually it is harder to make reports with such a table although there are always exceptions to the rule.

Regards.

Not applicable

How Trasform Row in Column???

Agree with Karl but sometimes there is exceptions really :-)

If you really want to make it this way you may have a look at "generic load". See the link bellow for more info

http://qlikviewnotes.blogspot.com/2010/05/use-cases-for-generic-load.html

How Trasform Row in Column???

Hello Federico,

Try the solution provided by John Witherspoon in this post.

Regards.

Luminary
Luminary

How Trasform Row in Column???

I'd go with the generic load approach mentioned by Stefan, although you are going to have to create a column that contains the 1,2,3 etc. For that you can try something like the following (not tested) when you load Table A.

Load Customer, Contact, Type, Email,

if(rowno()=1 or Customer <> previous(Customer), 1, previous(CustomerContactRowNo)+1) as ContactRowNo

Resident [Table A];

If previous(Customer) doesn't work try peek('Customer').

Edit: Sorry, I forgot to mention that you have to order Table A first by Customer before using the above script.

Regards.

fedcas
New Contributor III

How Trasform Row in Column???

Thank af all for your precious help!

I tried Generic Load with last ppost of Karl to create the sequence, but just on this instruction there if a problem. In the first record Qv answer me " didn't find field ContacRowNo !"

So, How do I use "peek"?

Thanks

fedcas
New Contributor III

How Trasform Row in Column???

FOUND!

if

(rowno()=1 or Customer <> previous(Customer), 1, numsum( 1, peek( 'ContactRowNo' ) )) as ContactRowNo

THANKS!!!!!!

Now I'll try the rest of the problem...





fedcas
New Contributor III

How Trasform Row in Column???

Big Smile GOAL!!!!

THANK YOU VERY MUCH AT ALL!!!!

I hope to return the favor as soon as possible!

Ciao Yes

fedcas
New Contributor III

How Trasform Row in Column???

Big Smile GOAL!!!!

THANK YOU VERY MUCH AT ALL!!!!

I hope to return the favor as soon as possible!

Ciao Yes

llauses243
Contributor III

How Trasform Row in Column???

Hi Fede,

This is my simple offer

good luck , Luis

Community Browser