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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
vikas_nandanwar
Creator II
Creator II

Average Inventory Calculation

Hi,

Avg( Aggr( Sum(Qtyl), Date))

The above expression worked to some extent.

Now When i am drilling down to the final date, Its not giving me the correct answer.

I have my data as -

    

DateDeptWorkCenterSub DeptQtyCo. CodeType
2-Jan-17MfgAPURE10ZZGold
2-Jan-17RMBKARAT30XXPlatinum
2-Jan-17MfgCPURE30YYSilver
2-Jan-17JWASPRUE20ZZPlatinum
2-Jan-17MfgDFIL40XXGold
2-Jan-17RMDBAG50YYSilver
3-Jan-17MfgACHK10WWPlatinum
3-Jan-17JWBFIL20VVGold
3-Jan-17MfgCFILWIP20WWGold
3-Jan-17JWBCHK10VVSilver
3-Jan-17RMCFIL30XXPlatinum
3-Jan-17RMBBAG30ZZPlatinum
3-Jan-17MfgACHK20YYSilver
4-Jan-17JWBFIL50VVGold
4-Jan-17MfgCFILWIP10WWGold
4-Jan-17RMBBAG20VVSilver
4-Jan-17MfgCFIL40XXPlatinum
4-Jan-17JWAAAG40ZZSilver
4-Jan-17MfgDFIL20WWGold
4-Jan-17RMAAAG10YYPlatinum

I need to check drill down on a single date say 2nd Jan = Total Inventory of Qty = 180

Note this is sample data and will contain data from 1st Jan to 31st Oct.


Thanks,

Vikas

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Try this?

Avg(Aggr(Sum({<Dept = {'Mfg'}>} Qty),Date))

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

View solution in original post

26 Replies
Anil_Babu_Samineni

What you are drilling and to where? What is the mean of Max date?

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
vikas_nandanwar
Creator II
Creator II
Author

My Drill Down is

Dept-WorkCenter-Sub Dept

My Selection is a single date say 2nd Jan
I should get answer as 180 as my qty total

shraddha_g
Partner - Master III
Partner - Master III

In Which Chart you are trying this?

Anil_Babu_Samineni

Try this?

Avg(Aggr(Sum({<Dept = {'Mfg'}>} Qty),Date))

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
vikas_nandanwar
Creator II
Creator II
Author

My aim is

When I drill down to final single date, it should give me sum

All other columns should give me average

vikas_nandanwar
Creator II
Creator II
Author

This doesn't give me answer, Since my dept has multiple options Mfg is only one of them, I have JW, RM as other options

vikas_nandanwar
Creator II
Creator II
Author

Simple Bar chart and KPI

Anil_Babu_Samineni

Can you elaborate more clear your requirement, If you select 2nd Jan Navigate to this?

DateDeptWorkCenterSub DeptQtyCo. CodeType
2-Jan-17MfgAPURE10ZZGold
2-Jan-17RMBKARAT30XXPlatinum
2-Jan-17MfgCPURE30YYSilver
2-Jan-17JWASPRUE20ZZPlatinum
2-Jan-17MfgDFIL40XXGold
2-Jan-17RMDBAG50YYSilver

From this, Data it will give simple as

Sum(TOTAL Qty)

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
prma7799
Master III
Master III

Have you tried this?

Avg( Aggr( Sum(Qtyl), Date,Dept,WorkCenter,[Sub Dept]))