I'm entirely willing to admit that I am going about this incorrectly, but here's the situation. I was given a table like this:
qtr cust_type cust_cnt
QTR1 new_cust 100
QTR1 return_cust 50
QTR2 new_cust 150
QTR2 return_cust 75
and I am trying to create a new cust_type row for each qtr that shows the combined amounts of the other cust_types, like this as an end result:
qtr cust_type cust_cnt
QTR1 new_cust 100
QTR1 return_cust 60
QTR1 total_cust 160
QTR2 new_cust 150
QTR2 return_cust 75
QTR2 total_cust 225
Why on earth would I do this? The reason is not great- Tableau is very picky about how information is input in order to form specific graph types.
Is there some SQL syntax that can accomplish the second graph? I cannot seem to figure one out. I'm also very new to SQL :D
unionapproach should be good too.50in the first quarter for returning customers becomes60?