Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
CustomerId | ContactInfo | Value |
---|---|---|
1 | Name | Test 1 |
1 | Adress | Test street |
2 | Name | Test 2 |
What I would like to achieve is a result that looks like this:
CustomerId | Name | Adress |
---|---|---|
1 | Test 1 | Test street |
2 | Test 2 | Test street |
Try this?
= Pick(Match(ContactInfo, 'Name', 'Adress'), IF(Len(Trim(Value))=0, '',Value), IF(Len(Trim(Value))=0, 'Test Street',Value))
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.
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?
Try this?
= Pick(Match(ContactInfo, 'Name', 'Adress'), IF(Len(Trim(Value))=0, '',Value), IF(Len(Trim(Value))=0, 'Test Street',Value))
You could try with a generic load
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
Hi,
Refer this app,