Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
rathorep
Contributor III
Contributor III

Group by in front end

Below is my dummy data, 

my requirement is to calculate

Ticket number: Modified Group name: and Total time spent by each group on per ticket.

In below data we have ticket number(just filtered for 1 ticket), Modified group name(Group who modifies the ticket),

Modified Date(Date on which ticket has been modified by group.

Last column i am calculating difference of time on each line. i.e. when Modified date when Ticket first assigned to next group(B) - Modified Date when ticket first assigned to group A

I was trying to sum up last column group by Ticket number and Modified group name by formula 

Sum(Aggr((interval((Below(Total ([Modified Date]),1,1)-[Modified Date]),'hh.m')),[Modified Group Name],[Ticket Number]))

But getting only zero for each line.

Please help!

Ticket NumberModified DateModified Group Nameinterval((Below(Total ([Modified Date]),1,1)-[Modified Date]),'hh.m')
178110/3/2019 12:11A0.46
178110/3/2019 12:58B3.11
178110/3/2019 16:09C14.16
178110/4/2019 6:25A126.52
178110/10/2019 5:40B16.22
178110/11/2019 7:37C25.57
1 Solution

Accepted Solutions
sunny_talwar

or may be this

Interval(
  Sum(Aggr(
    
    Interval(Below([Modified Date]) - [Modified Date], 'hh.m')

  , [Ticket Number], ([Modified Date], (NUMERIC))))
, 'hh.mm')

View solution in original post

42 Replies
sunny_talwar

How about this

Sum(Aggr(
    
    Interval(Below(TOTAL [Modified Date]) - [Modified Date], 'hh.m')

, [Ticket Number], ([Modified Date], (NUMERIC))))
rathorep
Contributor III
Contributor III
Author

Hi.. I tried this but not working

sunny_talwar

Can you elaborate a little on what exactly do you mean that it is not working? Does it give you wrong numbers or do you get null?

rathorep
Contributor III
Contributor III
Author

This is the result set I am getting 

 

Ticket NumberModified Group NameField Modified Dateinterval((Below(Total ([Field Modified Date]),1,1)-[Field Modified Date]),'hh.m')Sum(Aggr(Interval(Below(TOTAL [Field Modified Date]) - [Field Modified Date], 'hh.m'), [Ticket Number],[Field Modified Date], ([Field Modified Date], (NUMERIC))))
Total    -60.33724537
1781A10/3/2019 12:1100.460.032557870370511
1781B10/3/2019 12:5803.110.13273148147709
1781C10/3/2019 16:0914.160
1781A10/4/2019 6:2506.52-0.75986111110979
1781B10/9/2019 13:1816.22-5.2864699074053
1781C10/10/2019 5:4001.57-0.6825115740794
1781B10/11/2019 7:3707.32-1.0812847222187
sunny_talwar

This is displaying the output as a number, I guess you need it as duration... try this

Interval(
  Sum(Aggr(
    
    Interval(Below(TOTAL [Modified Date]) - [Modified Date], 'hh.m')

  , [Ticket Number], ([Modified Date], (NUMERIC))))
, 'hh.mm')

 

rathorep
Contributor III
Contributor III
Author

Result set which i want is:

Ticket NumberModified Group NameTotal hours spent by each team
1781A127.39
1781B363.06
1781C40:13:00
sunny_talwar

How are you getting those numbers? Can you elaborate please?

rathorep
Contributor III
Contributor III
Author

Ticket NumberModified Group NameField Modified Dateinterval((Below(Total ([Field Modified Date]),1,1)-[Field Modified Date]),'hh.m')Sum(Aggr(Interval(Below(TOTAL [Field Modified Date]) - [Field Modified Date], 'hh.m'), [Ticket Number],[Field Modified Date], ([Field Modified Date], (NUMERIC))))
Total    -60.33724537
1781A10/3/2019 12:110.460.03255787
1781B10/3/2019 12:583.110.132731481
1781C10/3/2019 16:0914.160
1781A10/4/2019 6:256.52-0.759861111
1781B10/9/2019 13:1816.22-5.286469907
1781C10/10/2019 5:401.57-0.682511574
1781B10/11/2019 7:377.32-1.081284722
     
     
Ticket NumberModified Group NameTotal hours spent by each team  
1781A6.98All values under 4th column belongs to A team i.e. 0.46+6.52 
1781B26.65All values under 4th column belongs to B team i.e. 3.11+16.22+7.32 
1781C15.73All values under 4th column belongs to C team i.e. 14.16+1.57 

 

 

 

Basically 4th column is having value (10/3/2019 12:58:00 PM - 10/3/2019 12:11:00 PM= 0.46) which is the time calculated when ticket is assigned to B minus ticket assigned to A.

sunny_talwar

This make sense

"Basically 4th column is having value (10/3/2019 12:58:00 PM - 10/3/2019 12:11:00 PM= 0.46) which is the time calculated when ticket is assigned to B minus ticket assigned to A."

But can you go over these

1) How did you arrive at 7.32... 10/11/2019 7:37 is the last row... what x - 10/11/2019 7:37 = 7.32... what is x here?

image.png

 

2) How did you get 6.52? 10/9/2019 13:18 - 10/4/2019 6:25 would be several days so should be more than 24 hours?

image.png