Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
fedcas
Partner - Contributor III
Partner - 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

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

View solution in original post

9 Replies
pover
Luminary Alumni
Luminary Alumni

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

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

Miguel_Angel_Baeyens

Hello Federico,

Try the solution provided by John Witherspoon in this post.

Regards.

pover
Luminary Alumni
Luminary Alumni

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
Partner - Contributor III
Partner - Contributor III
Author

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
Partner - Contributor III
Partner - Contributor III
Author

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
Partner - Contributor III
Partner - Contributor III
Author

Big Smile GOAL!!!!

THANK YOU VERY MUCH AT ALL!!!!

I hope to return the favor as soon as possible!

Ciao Yes

fedcas
Partner - Contributor III
Partner - Contributor III
Author

Big Smile GOAL!!!!

THANK YOU VERY MUCH AT ALL!!!!

I hope to return the favor as soon as possible!

Ciao Yes

llauses243
Creator III
Creator III

Hi Fede,

This is my simple offer

good luck , Luis