Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

gauravgg
New Contributor III

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

Tags (1)
1 Solution

Accepted Solutions

Re: How to use crosstable for the following ?

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;

1 Reply

Re: How to use crosstable for the following ?

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;