Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Data_Derek
Contributor
Contributor

Merging Dimensions

Looking for a solution to merge two dimensions (not concatenate).

I have two dimensions, Crew1Name and Crew2Name, coming from the same source.

 

Example:

Crew1Name        Crew2Name     Count

John Smith          Jane Doe          2

Jimmy T               John Smith       3

Jane Doe             Jacky C            8

 

I would like to create a table where there is a count of events where:

 

Name (Combined)                      Count (Combined)

John Smith                                   5

Jane Doe                                      10

Jimmy T                                        3

Jacky C                                        8

Labels (4)
4 Replies
Anil_Babu_Samineni

@Data_Derek Perhaps this?

Example: // This is not necessary if data come from source.
Load * Inline [

Crew1Name , Crew2Name , Count

John Smith , Jane Doe , 2

Jimmy T , John Smith , 3

Jane Doe , Jacky C , 8
];

T1:
Load Crew1Name as "Name (Combined)", Count as "Count (Combined)" Resident Example;
Concatenate
Load Crew2Name as "Name (Combined)", Count as "Count (Combined)" Resident Example;

Final:
NoConcatenate
Load "Name (Combined)", Sum("Count (Combined)") as "Count (Combined)" Resident T1 Group By "Name (Combined)";

Drop Tables Example, T1;

 

Output:

Anil_Babu_Samineni_0-1706627360825.png

 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
qv_testing
Specialist II
Specialist II

Try this

 

Data:
LOAD * INLINE [
Crew1Name , Crew2Name , Count
John Smith , Jane Doe , 2
Jimmy T , John Smith , 3
Jane Doe , Jacky C , 8
];

MainTable:
LOAD Crew1Name as Name,
Count
resident Data;
concatenate
Load Crew2Name as Name,
Count
Resident Data;

Drop table Data;

EXIT SCRIPT;

Data_Derek
Contributor
Contributor
Author

Thank you Anil,

Would you have any suggestions on how I may be able to accomplish this in the front end (outside of the dataload)?

Chanty4u
MVP
MVP

Try this

Data:

LOAD Crew1Name as Name,

     Count

Resident YourTable;

 

Concatenate 

LOAD Crew2Name as Name,

     Count

Resident YourTable;

 

In presentation:

Dimension: Name

Measure: Sum(Count)