Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
harson
Contributor III
Contributor III

Calculation based on selected dimensions

Hello Community,

I have a problem on QlikView at this time,

I have to calculate the working times (DT) to suit the selected pause types.

First I have to create check boxes for my different types of pause, like this:

      Avec Pause Administrative

       Avec Pause toilette

      Avec Pause déjeuner

       Avec Pause 15min

The formula for working time (TD) is : DT = [Work_duration] – [pause_duration] with pause_duration is the value of  pause_duration for the checked boxes.

For example :

            In 03/04/2017

-          If I check « Avec Pause Adminitrative »

=> DT = [Work_duration]-[pause_duration] for the pause_code= PA

ð  DT = 158 :25 :00 – 04 :30 :00

-          If I check  « Avec Pause Adminitrative », « Avec Pause toilette »

=> DT = [Work_duration]-[pause_duration] for the pause_code = PA et PT

ð  DT = 158 :25 :00 – (04 :30 :00 + 04 :20 :00)

-          And if I don’t check anything on the ticked boxes DT= [Work_duration]

Any idea ?

Thanks in advance.

This is my  data :

Pause :
LOAD * INLINE [
     Date, pause_duration, pause_code
     03/04/2017, 04:30:00, PA
     04/04/2017, 03:15:00, PA
     05/04/2017, 04:48:00, PA
     06/04/2017, 03:21:00, PA
     07/04/2017, 03:54:00, PA
     03/04/2017, 04:20:00, PT
     04/04/2017, 04:15:00, PT
     05/04/2017, 04:48:00, PT
     06/04/2017, 04:21:00, PT
     07/04/2017, 20:15:00, PT
     03/04/2017, 19:15:00, PD
     04/04/2017, 19:53:00, PD
     05/04/2017, 18:04:00, PD
     06/04/2017, 19:53:00, PD
     07/04/2017, 19:25:00, PD
     03/04/2017, 05:15:00, P15
     04/04/2017, 04:52:00, P15
     05/04/2017, 03:00:00, P15
     06/04/2017, 04:29:00, P15
     07/04/2017, 05:25:00, P15
]
;

Pause_description :
LOAD * INLINE [
     pause_code, pause_description
     PA, Pause Administrative
     PT, Pause toilette
     PD, Pause déjeuner
     P15, Pause 15min
]
;


Work :
LOAD * INLINE [
     Date, Work_duration
     03/04/2017, 158:25:00
     04/04/2017, 160:12:00
     05/04/2017, 159:12:00
     06/04/2017, 160:03:00
     07/04/2017, 159:32:00
]
;
 

0 Replies