Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
gauravgg
Partner - Creator
Partner - Creator

How to use crosstable for the following ?

Hi

I have the following  table

StateJanSalesJanOrdCountFebSalesFebOrdCount
A10000454700023
B30000256700043

Using crosstable can we get following table output

StateMonthSalesOrderCount
AJan1000045
AFeb4700023
BJan3000025
BFeb6700043

thanks in Advance

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Perhaps like this:

tempSales:

CrossTable(Month,Sales)

LOAD

     State,

     JanSales,

     FebSales,

FROM

     ....source...

     ;

tempOrderCount

CrossTable(Month,OrderCount)

LOAD

     State,

     JanOrdCount,

     FebOrdCount,

FROM

     ....source...

     ;

Result:

NoConcatenate

LOAD

     State,

     Left(Month,3) as Month

     Sales

Resident

     tempSales

     ;

Drop table tempSales;

JOIN (Result)

LOAD

     State,

     Left(Month,3) as Month

     OrderCount

Resident

     tempOrderCount

     ;

Drop table tempOrderCount;


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar

Perhaps like this:

tempSales:

CrossTable(Month,Sales)

LOAD

     State,

     JanSales,

     FebSales,

FROM

     ....source...

     ;

tempOrderCount

CrossTable(Month,OrderCount)

LOAD

     State,

     JanOrdCount,

     FebOrdCount,

FROM

     ....source...

     ;

Result:

NoConcatenate

LOAD

     State,

     Left(Month,3) as Month

     Sales

Resident

     tempSales

     ;

Drop table tempSales;

JOIN (Result)

LOAD

     State,

     Left(Month,3) as Month

     OrderCount

Resident

     tempOrderCount

     ;

Drop table tempOrderCount;


talk is cheap, supply exceeds demand