Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

One to many

I have a database with one to many relationship.

Its two tables, customerid and ContactInfo, the key in the tables are customerid.

In the Contactinfo table there is a field "value"

If I load the tables in a straight chart and uses the CustomerId as dimension the results looks like this:

CustomerIdContactInfo Value
1NameTest 1
1AdressTest street
2NameTest 2

What I would like to achieve is a result that looks like this:

CustomerIdNameAdress
1Test 1Test street
2Test 2Test street
1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Try this?

= Pick(Match(ContactInfo, 'Name', 'Adress'), IF(Len(Trim(Value))=0, '',Value), IF(Len(Trim(Value))=0, 'Test Street',Value))

View solution in original post

6 Replies
vishsaggi
Champion III
Champion III

Try using a pivot table and add

Dimensions:

CustomerId

ContactInfo

Expr:

= IF(Len(Trim(Value)) = 0, 'Test Street', Value)

Then move your ContactInfo to top of the expression. Something like this.

Capture.PNG

Not applicable
Author

Very helpful, thank you!

But if the contact info includes for ex Telephone number and I dont want to show that field, is there a way in the expression to decide which contactinfo values that will show in the chart?

vishsaggi
Champion III
Champion III

Try this?

= Pick(Match(ContactInfo, 'Name', 'Adress'), IF(Len(Trim(Value))=0, '',Value), IF(Len(Trim(Value))=0, 'Test Street',Value))

MarcoWedel

You could try with a generic load

sasiparupudi1
Master III
Master III

Use Generic Load

t1:

Load * Inline

[

CustomerId,ContactInfo,Value

1,Name,Test 1

1,Adress,Test street

1,Telphone,Test street

2,Name,Test 2

];

GenericCust:

Generic LOAD

CustomerId,ContactInfo,Value

Resident t1;

drop Table t1;

hth

Sas

muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

Refer this app,

Muthukumar Pandiyan