Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikuser222
Creator
Creator

Cross table

Hi,

I have a requirement which needs data transformation i.e cross table.

Can anyone please let me know how to do it?

load * inline [
Key, name, age
1, John, 12
1, Sam, 13
1, Mike,14
2, John, 15
2, Sam, 16
2, Mike, 17
3, John, 18
3, Sam, 19
3, Mike, 20]
;


/*
out put should be

Key John Sam Mike
1 12 13 14
2 15 16 17
3 18 19 20

1 Solution

Accepted Solutions
sunny_talwar

Look at another thread from today which you might find useful -> Re: Any alternate to Generic load?

But just so you know that different table created by Generic load isn't a bad thing as pointed by HIC here -> The Generic Load‌ and there are ways to make it to concatenate all the individual tables into one big fact table.

Another option discussed can be found here -> Re: Dynamically Naming a Field in Load

View solution in original post

4 Replies
sunny_talwar

Try this:

Generic

LOAD * Inline [

Key, name, age

1, John, 12

1,  Sam, 13

1, Mike,14

2, John, 15

2, Sam, 16

2, Mike, 17

3, John, 18

3, Sam, 19

3, Mike, 20];


Capture.PNG

qlikuser222
Creator
Creator
Author

Thanks for the reply Sunny, but real data has 50 distinct names, which gives us 50 extra tables in the schema.

is there any way to avoid it?

sunny_talwar

Look at another thread from today which you might find useful -> Re: Any alternate to Generic load?

But just so you know that different table created by Generic load isn't a bad thing as pointed by HIC here -> The Generic Load‌ and there are ways to make it to concatenate all the individual tables into one big fact table.

Another option discussed can be found here -> Re: Dynamically Naming a Field in Load

marcus_sommer

You could join these tables after the generic load, see: Generic Load Joining

- Marcus