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

Expression in %

Hi all,

I want to calculate the % of [#Time Worked] per [Jobcode Flag].

There are only 2 [Jobcode Flag] values: Productive and Non Productive

 

Jobcode Flag
Productive
Non Productive

When nothing is selected then the values for expression [#Time Worked] are displayed correctly for both [Jobcode Flag] fields.

Butnot for expression [=vTimeWorked], the total TimeWorked is showed there instead of x... time Productive and x... Time Non Productive.

   

Total Time Worked
Jobcode Flag#TimeWorked=vTimeWorked
100%7:42:37
Productive47,08%7:42:37
Non Productive52,92%7:42:37

This is the result I would like to see:  

Total Time Worked
Jobcode Flag#TimeWorked=vTimeWorked
100%7:42:37
Productive47,08%3:37:47
Non Productive52,92%4:04:50

When I select a [Jobcode Flag] Productive then the value of the expression #TimeWorked becomes 100% instead of 47,08%

If  I select Non Productive the same happens.

I have the same problem for this Table with expression %PP:

If I make a selection 'Productive' the value should be 47,08%, Non Productive should be 52,92% and if no selection is made then the value should be 100%

         

Assignments by employee
Employee Badge#Time Worked#Colli#AssignmentsAverage AssignmentsProductivityTargetPercentage%PP
51397:42:375392224,569,91137,250,95%

-

Can anyone help me with this problem please? I'll attach a copy of the qvw to make it easy to so see what is going on.

Kind regards,

Monique

1 Solution

Accepted Solutions
sunny_talwar

Can you try this

=sum({$<[Jobcode]={"*"}-{"ILUNP"},[Employee Department]={"*"}-{"Bediende", "Carrefour", "Extern"}>} if([Aisle Zone]='FORK' and [Jobcode]<>'IINCH' and [Jobcode]<>'DPURP'

,[Assignment Replenish Time], [Assignment Time Worked]-[Assignment Beginday Difference]))

/

Sum(TOTAL <[Employee Badge]> {<[Jobcode Flag]>}Aggr(sum( {$<[Jobcode]={"*"}-{"ILUNP"},[Employee Department]={"*"}-{"Bediende", "Carrefour", "Extern"}, [Jobcode Flag]>} if([Aisle Zone]='FORK' and [Jobcode]<>'IINCH' and [Jobcode]<>'DPURP'

,[Assignment Replenish Time], [Assignment Time Worked]-[Assignment Beginday Difference])), [Employee Badge], [Jobcode Flag]))

If this doesn't work, would you be able to share an updated sample?

View solution in original post

17 Replies
Anil_Babu_Samineni

For first output you may need this?

Capture.PNG

=sum({$<[Jobcode]={"*"}-{"ILUNP"}>} if([Aisle Zone]='FORK' and [Jobcode]<>'IINCH' and [Jobcode]<>'DPURP' and [Action Code] <> 'PM' ,[Assignment Replenish Time], [Assignment Time Worked]-[Assignment Beginday Difference]))

And second one are you talking about %PP?? If so, What value you are expecting to see

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
amber2000
Creator
Creator
Author

If I make a selection 'Productive' the value should be 47,08%, Non Productive should be 52,92% and if no selection is made then the value should be 100%

sunny_talwar

May be like attached

aarkay29
Specialist
Specialist

PFA

Updated with PP%

Thanks,

Aar

amber2000
Creator
Creator
Author

Thanks Sunny,

Do you also Know how to handle the expression that's needed for %PP please?

Monique

sunny_talwar

Check now

amber2000
Creator
Creator
Author

Thanks Sunny,

This is what I wanted, and actually this isn't so difficult.

Kind regards,

Monique

amber2000
Creator
Creator
Author

Thanks Aar,

Your solution is the same as Sunny's.

I would like to thank you all for helping me.

You guys are great

Monique

amber2000
Creator
Creator
Author

Sunny,

I'm sorry but with one record everything looked good.

But there is still something not quit wright, I've added a few more records to see the difference.

If I select nothing so the %PP should give me 100% per record. (It's not doing that, the 100% is splitted into 5 values, 1 value per record)

         

Employee Badge#Time Worked#Colli#AssignmentsAverage AssignmentsProductivityTargetPercentage%PP
26357:47:004631142,0959,49185,2032,12%21,66%
41037:45:263921428,0050,53148,4034,05%21,59%
47085:09:368341943,89161,63193,1483,69%14,36%
51397:42:375392224,5069,91137,2050,95%21,45%
91247:31:351.6014436,39212,72163,74129,91%20,94%

When I select Productive then the % changes to less:         

Employee Badge#Time Worked#Colli#AssignmentsAverage AssignmentsProductivityTargetPercentage%PP
26352:08:15463857,88216,61214,14101,15%5,95%
41032:09:033921135,64182,25160,36113,65%5,98%
47085:02:118341846,33165,59194,6085,09%14,01%
51393:37:475391928,37148,50147,52100,66%10,10%
91246:51:301.6014139,05233,44175,72132,85%19,08%

For EmployeeBadge the Productive %PP should be 27,46% and whatever the selection I make it's not showing the correct result.

In the Main tab the result of %PP is also different, it should show the same result (here the dimension is Department instead of EmployeeBadge

Do you know what's wrong?

Monique