Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Simon4
Creator
Creator

One row in table

Hi all,

 

I have the following table:

Simon4_0-1669033140570.png

 

 

My goal is to have all this information in one row. First column has the same information (project name and customer name). How do I achieve this?

Thank you in advance.

 

Kind regards,

Simon

Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

your table rows will naturally aggregate to common dimension values,

your revenue numbers are aggregating on different rows which indicates that your dimension values are not the same

 

vinieme12_0-1669108800452.png

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

5 Replies
Dalton_Ruer
Support
Support

If I am understanding correctly you want the totals of the values for the first several columns. Not sure how you wanted to handle the last several. So the following code illustrates two options for those last fields and pulls the maximum string value from the Incoterm field, but concatenates the distinct values from the Country field. Here is the code and screen shot of what the combined values would look like.

TempData:
Load * Inline [
Customer, SalesPrice, Commission, AddWork, Revenue, Incoterm, Country
Customer1, 158, 0, 0, 158, FCA, ROU
Customer1, 0, -24, 0, -24, , ROU,
Customer2, 160, 10, 25, -10, WHO, FRA
Customer2, 200, 35, 50, -35, OTHER, SP
];

Data:
NoConcatenate Load
Customer,
Sum(SalesPrice) as Total_SalesPrice,
Sum(Commission) as Total_Comission,
Sum(AddWork) as Total_AddWork,
Sum(Revenue) as Total_Revenue,
MaxString(Incoterm) as Max_Incoterm,
Concat(Distinct Country, ', ') as Combined_Country
resident TempData
Group By Customer;

 

CombinedData.png

 

Simon4
Creator
Creator
Author

But if I understand correctly I have to fill everything in manually? 

vinieme12
Champion III
Champion III

your table rows will naturally aggregate to common dimension values,

your revenue numbers are aggregating on different rows which indicates that your dimension values are not the same

 

vinieme12_0-1669108800452.png

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Dalton_Ruer
Support
Support

No you don't have to fill in the values manually. My sample code can be copied and pasted as is. I used various aggregation functions to illustrate that you can do group by statements to aggregate values up as needed.

Simon4
Creator
Creator
Author

You were right, I corrected a few formula's and now it is all in one row. thank you!