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

CrossTable()

Hi all,

i have the following table format:

IDStstusDaysInStatus
1New3
1Active2
1InTest1
1Completed4

I want to transform the table above in a table like this:

ID[Days in New][Days in Active][Days in In Test]{Days In Completed]
13214





I think this is possible using CrossTable(), but i cant get it to work.

Thanks a lot!

4 Replies
sivarajs
Specialist II
Specialist II

try using generic load

Not applicable
Author

thanks, but isnt it possible to create a table like i want in the data model ?

narender123
Specialist
Specialist

Hi,

for this you can use pivot table to show data like this.

see in attachment

Regards:

Narender

rustyfishbones
Master II
Master II

If you want this in the Script you could try, not sure if it's the best solution but try it

LOAD ID,

     Ststus as Status,

     IF(DaysInStatus=1,DaysInStatus) AS [Days In Test],

     IF(DaysInStatus=2,DaysInStatus) AS [Days In Active],

     IF(DaysInStatus=3,DaysInStatus) AS [Days In New],

     IF(DaysInStatus=4,DaysInStatus) AS [Days In Completed]

FROM