Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
tan_chungkam
Creator
Creator

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
Specialist
Specialist

ChennaiahNallani
Creator III
Creator III

Try like below.

 

CrossTable(Week,Cost)
Load
*
From tableName

tan_chungkam
Creator
Creator
Author

Hi, 

thanks for reply.

However, it doesn't work.

ChennaiahNallani
Creator III
Creator III

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;

martinpohl
Partner - Master
Partner - Master

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