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

How to transform excel pivot into something useful!

Hello,

I have a excel spreadsheet that will likely grow with more people / courses which I'd like to report on. It's currently in a pivot style formatting (see attached).

I think I need to split them out into two or three tables, but not sure how... What I'm after is the employee, linked to the training course with the date they completed the course, then maybe another table with the training course and the repeat period? For example:

Auto IdEmployee NameEmployee number
1Joe Bloggs111
2Davey Jones222
3Sarah Smith333

Auto IdTraining CourseRepeat Period
1Health and Safety Induction2 years
2Hygiene / H&S Rules2 years
3HSE Charter2 years

Employee IdTraining IdDate
1101/10/2018
1205/10/2018
1310/10/2018

Can you help how to make sense of this spreadsheet? Many thanks!!

Kind Regards,

Dayna

1 Solution

Accepted Solutions
prieper
Master II
Master II

Hi Dayna,

You need to advise QV, which are the fixed dimensions in your CROSSTABLE-extraction,

i.e.

CROSSTABLE(Course, CourseDate, 2) LOAD ...

will take the first two fields as dimensions and then write each following fieldname and -value into a new line (by repeating the dimensions) into fields "Course" and "CourseDate".

HTH Peter

View solution in original post

5 Replies
prieper
Master II
Master II

not sure, what you are aiming at.

Surely you may load the table with CROSSTABLE-functionality, i.e.

Courses:

    CROSSTABLE(Course, CourseDate, 2) LOAD

        *

    FROM

    courses.xlsx

    (ooxml, embedded labels, header is 2 lines, table is Data);

This would already give a kind of normalized table with employess and courses (and the date?)

Dayna
Creator II
Creator II
Author

Hi @Peter,

I've never used the crosstable function, but looks like it would work. How would that work on my spreadsheet? I presume it would still need transforming?

I just tried it with the following:

CrossTable (Name, Date) LOAD

*

FROM

[\\ffle.xls]

(biff, no labels, table is Sheet1$);

And what I get is two fields, but with a mix of data in both. i.e. in 'Date' I get 2 years, the training names, and dates. Whereas in Name, I get a lot of the column references, i.e. @1, @2, @3, ... etc.

Many thanks,
Dayna

prieper
Master II
Master II

Just give it a try ...

In the above example you need to replace

"courses.xlsx"

with the path and name to your excel-file.

It is also possible to read the course-names and link it with the repeating-frequency (from the line above), but think this info a somewhat static. It might be easier to make the transformation within Excel and to load this as further attribute to the courses .

Peter

Dayna
Creator II
Creator II
Author

Hi Peter,

I have tried but what I get is two fields, but with a mix of data in both. i.e. in 'Date' I get 2 years, the training names, and dates. Whereas in Name, I get a lot of the column references, i.e. @1, @2, @3, ... etc.


Do I need to do any transform before I do this?


Many thanks,

Dayna

prieper
Master II
Master II

Hi Dayna,

You need to advise QV, which are the fixed dimensions in your CROSSTABLE-extraction,

i.e.

CROSSTABLE(Course, CourseDate, 2) LOAD ...

will take the first two fields as dimensions and then write each following fieldname and -value into a new line (by repeating the dimensions) into fields "Course" and "CourseDate".

HTH Peter