Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Restructuring Data on Loading

Hi QlikView Experts,

Can someone help me please?

I am trying to restructure a data set upon loading it into Qlikview. What I want is for the status dates to appear as the field with the data values as the data within the field for each document number.

To give a simplified example:

My data structure currently is:

DocNumberStatusDate
1Scanned01/08/2011
1Waiting Coder Action03/08/2011
1In Query05/08/2011
1Waiting Payment07/08/2011
2Scanned07/08/2011
2Waiting Coder Action09/08/2011
2In Query11/08/2011
3Scanned13/08/2011
2Waiting Payment15/08/2011
2Completed17/08/2011
4Scanned19/08/2011
4Waiting Coder Action21/08/2011
4In Query23/08/2011

And I need to be able to look at the time lags between status dates so need QlikView to restructure the data into the table format below:

DocNumberCompletedIn QueryScannedWaiting Coder ActionWaiting Payment
105/08/201101/08/201103/08/201107/08/2011
217/08/201111/08/201107/08/201109/08/201115/08/2011
313/08/2011
423/08/201119/08/201121/08/2011

Is this possible? If so, how?

To be more specific there are around 30-40 statuses with a seperate line in the current data set for each.

Kind Regards

Becky

8 Replies
its_anandrjs
Champion III
Champion III

Hi,

Yes it is possible you need to crate a pivot table in this type of requirements on that you need to create a pivot table and arrange a table like you want it by drag and drop the fields.

Anand

its_anandrjs
Champion III
Champion III

Hi,

There is no limit for the status column if there is many types of the status available it will create by the pivot table.

Just put DocNumber, Status field in the Dimensions and in expression date field.

And after creating of the pivot table just click on the Status column and drag it towards the right top corner then you see the Status column goes upwards.

And let me know

Regards

Anand

gandalfgray
Specialist II
Specialist II

Hi RB

You can use Generic Load

Generic LOAD DocNumber,

     Status,

     Date

FROM

indata.txt

(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

Heres an example of a straight table chart using the loaded data:

genericload.JPG

hth/gg

Not applicable
Author

Hi All,

Many thanks for such quick responses they are much appreciated. Unfortunately the pivot tables do not give the required data structure as I need to start analysing the times between the different statuses. e.g.

DocNumberTime From Scan To Waiting Coder ActionTime From Waiting Coder Action To In QueryTime From In Query To Waiting PaymentTime From Waiting Payment To CompletedTotal Time to completeTotal Time in System
1222 6
222421010
3 0
422 4


And whilst I could use something such as the min to max total times, what I really want to know is how long the document has spent in each status. Therefore, I think that I need to restructure the data upon loading (unless there is a more intelligent way that I'm missing).

To make matters even more interesting, documents can move back and forth between statuses e.g. go in and out of query and therefore the total time in query is more important than the date. Is this possible to calculate in QlikView?

Once again, many thanks for all your help

Becky

gandalfgray
Specialist II
Specialist II

How about this then:

dochandl.JPG

the load script:

Docs:

LOAD DocNumber,

     Status,

     Date

FROM

145324.txt

(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

Left Join (Docs)

Load DocNumber,

    Max(Date)-Min(Date) As DaysInSystem

Resident Docs

Group By DocNumber;

StatusSort:

LOAD * INLINE [

    Status, StatusSort

    Scanned, 1

    Waiting Coder Action, 2

    In Query, 3

    Waiting Payment, 4

    Completed, 5

];

hth/gg

Not applicable
Author

Hi,

See if this is what you are looking for.

Cheers.

its_anandrjs
Champion III
Champion III

Hi,

See the attached sample if it is work for you. let me know if it is correct or not.

Regards

Anand

Not applicable
Author

Hi All,

A huge thanks for all your help on this issue.

I apologise for the late response, but it is really interesting and useful to know all the different ways that this can be achieved and I have adapted bits from a couple of the solutions mentioned above due to the different data sets I am receiving, therefore sorry that I couldn't tell you who have the "correct answer" as they all worked!

Kind Regards

RB