Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

tan_chungkam
Contributor

Crosstable

Hi Qlikers,

I would like to do a crosstable.

May I know how to do that?image.png

Labels (1)
5 Replies
Quy_Nguyen
Contributor III

Re: Crosstable

ChennaiahNallani
Contributor III

Re: Crosstable

Try like below.

 

CrossTable(Week,Cost)
Load
*
From tableName

tan_chungkam
Contributor

Re: Crosstable

Hi, 

thanks for reply.

However, it doesn't work.

ChennaiahNallani
Contributor III

Re: Crosstable

try this.

table:
Load *
from tablename;

NoConcatenate
t:
Load
ID,
Num(Date#(Week, 'DD/MM/YYYY')) as Week,
Cost
Resident table;

drop Table table;

t1:
Generic
Load
*
Resident t;

t2:

LOAD DISTINCT ID RESIDENT t;

DROP TABLE t;

FOR i = 0 to NoOfTables()

t3:

LOAD TableName($(i)) AS Tablename AUTOGENERATE 1

WHERE WildMatch(TableName($(i)), 't1.*');

NEXT i

FOR i = 1 to FieldValueCount('Tablename')

LET vTable = FieldValue('Tablename', $(i));

LEFT JOIN (t2)
LOAD *
RESIDENT $(vTable);

DROP TABLE $(vTable);

NEXT i

DROP Table t3;

Partner
Partner

Re: Crosstable

you want to do this in a chart?

Create pivot table

select ID as dimension

select Week as column

use sum(Cost) as expression

Regards