Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Expression calculation aggregration

Hi ,

I am trying to calculate lead time for each order. Each order has 2 events created assignment and finished assignment.The data is more in pivot form meaning created assignment has its own row and finished assignment has its own row. Data looks something like this:

Data1.png

Using this data, i am trying to calculate the following table: Lead time column is the only expression and all other columns are dimensions. The problem i am facing here is when i am trying to calculate lead time, I want lead time values to show up on finished assignment event and created assignment both.However, i get the lead time sometimes on created assignment and sometimes on finished assignment but not on both events.(Here is the sample table)

Data.png

Calculation for Lead time is :

Floor(24*60*Interval(Avg(aggr(Rangemin(Frac(Only({<EventId={'FinishedAssignment'},PickUp_MHA={'WSQ2'},Delivery_MHA={'2*','1*'},WeekDay-={'Sat','Sun'},Hour={">=6<=23"}>}Timestamp(EventTime_sub))),maketime(23))-
Rangemax(frac(Only({<EventId={'CreatedAssignment'},PickUp_MHA={'WSQ2'},Delivery_MHA={'2*','1*'}, WeekDay-={'Sat','Sun'},Hour={">=6<=23"}>}Timestamp(EventTime_sub))),MakeTime(6))+
NetWorkDays(Only({<EventId={'CreatedAssignment'},PickUp_MHA={'WSQ2'},Delivery_MHA={'2*','1*'},WeekDay-={'Sat','Sun'}>}Timestamp(EventTime_sub)),
Only({<EventId={'FinishedAssignment'},PickUp_MHA={'WSQ2'},Delivery_MHA={'2*','1*'},WeekDay-={'Sat','Sun'}>}Timestamp(EventTime_sub))-1)*MakeTime(8),OrderNumber1)),'mm'))

I would like my table to be like the following:

 

Data3.png

I do not understand what is causing this issue. Can anyone please help?

Thanks,

Vidya Sagar

Labels (1)
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: Expression calculation aggregration

Hi,

try adding total<OrderNumber1>

 

change:

Avg(aggr(

 

to:

avg(total<OrderNumber1> aggr(

View solution in original post

2 Replies
Highlighted
Partner
Partner

Re: Expression calculation aggregration

Hi,

try adding total<OrderNumber1>

 

change:

Avg(aggr(

 

to:

avg(total<OrderNumber1> aggr(

View solution in original post

Highlighted
Creator II
Creator II

Re: Expression calculation aggregration

Thank you..It worked