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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Modify and calculate loaded data?

Hi everyone,

I'm a bit new to Qlikview, but I'm wondering if there is possible to work with the data i load, for example, if I load, data from to tables can I then in Qlikview calclulate, ex. amount = 12 and time = 2 and do 12/2 = 6 and then display 6. and so on?

Or do i need to make all calculations, modifications and so before loading it in to qlikview?

thanks in advance!

18 Replies
Not applicable
Author

In simple terms yes you can do it in Qlikview, the question is; "is it the right place to do it".  Remember about future proofing your corporate business logic to be product agnostic.

PrashantSangle

Hi,

can you share your Punches.qvd If possible

then provide sample data to work.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi,

Im still having some troubles..

When i do this load:

punches:

LOAD

     P_DATE as date,

     P_TYPE,

     If(P_TYPE=1,'In') as timestart,

     If(P_TYPE=2,'Out') as timeend

FROM

i get this  ( se image )

view1.jpg

And changing load to:

LOAD

     P_DATE as date,

     P_TYPE,

     If(P_TYPE=1,time(P_TIME/1440,'hh:mm')) as timestart,

     If(P_TYPE=2,time(P_TIME/1440,'hh:mm')) as timeend

FROM

i get this ( se image )

view2.jpg

I want it to be

date - in -  out

in one row, I hope u understand what I mean.?

( the 0 line i dont want to load. )

Not applicable
Author

you can try something like below

Table1:

ID, Date, In

Table2:

ID,Date, Out

Join Table1 and Table2

Not applicable
Author

can u please show example? where to specify load, from and so on.. thx!

Not applicable
Author

There are somany ways of doing this.You can either choose do to in script or in the object itself.

Not applicable
Author

You might want to add the NAME or ID to the below loads, because I see multiple records for a date.

TableName:

LOAD

     P_DATE as date,

     If(P_TYPE=1,time(P_TIME/1440,'hh:mm')) as timestart

FROM

WHERE

P_TYPE=1;

Join(TableName):

LOAD

     P_DATE as date,

     If(P_TYPE=2,time(P_TIME/1440,'hh:mm')) as timeend

FROM

WHERE

P_TYPE=2;

Not applicable
Author

Okey, now i have made some small progress. but still need to get one thing more right..

I have made som selections so i can show u easy. the line with the arrow to the right is the one i want to show, and only that line. ( I guess that there are 2 of each P_TYP=1 and P_TYPE=2 if u look at the result. )

view3.jpg

my code is:

timestart:
LOAD
    EMP,
    P_DATE as date,
     If(P_TYPE=1,time(P_TIME/1440,'hh:mm')) as timestart
FROM


WHERE P_TYPE=1;    

Join(timestart)
LOAD
    EMP,
    P_DATE as date,
    If(P_TYPE=2,time(P_TIME/1440,'hh:mm')) as timeend
FROM


WHERE P_TYPE=2;   

Join(timestart)
LOAD iUserID as EMP,
     szName AS namn
FROM


Load
    *,
    interval(timeend-timestart,'hh:mm') AS workedtime
Resident timestart;

Not applicable
Author

I think it is doing a Cartesian join, Modified the second load, can you try this .


Join(timestart)

LOAD

    EMP,

    P_DATE as date,

    If(P_TYPE=1,time(P_TIME/1440,'hh:mm')) as timestart,

    If(P_TYPE=2,time(P_TIME/1440,'hh:mm')) as timeend

FROM

WHERE P_TYPE=2;