Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
vikas_nandanwar
Creator II
Creator II

Last Entered Inventory Number

Hi,

I have data set including following Columns

Transaction Date, Data Week, Qty

I want last data week total Qty

Thanks,

Vikas

1 Solution

Accepted Solutions
vikas_nandanwar
Creator II
Creator II
Author

Sum({<Keyval={$(=Max(Keyval))}>}InvQty)

Is giving me the desired output

View solution in original post

26 Replies
Anil_Babu_Samineni

Perhaps this?

Sum({<[Data Week] = {$(=Max([Data Week])-1)}>} 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
vikas_nandanwar
Creator II
Creator II
Author

My Data set contains unique month and repeating Data Week as shown below

I want closing or last entered inventory of the month

Say Apr  = 10962411.34

   

MonthsDataWeekQty
Jan112294609.88
Jan211979212.28
Jan312375512.48
Jan412351222.22
Feb112649753.37
Feb212649753.37
Feb312968125.98
Feb413064135.69
Mar113337458.61
Mar213337458.61
Mar30
Mar40
Apr111719474.23
Apr210615512.64
Apr310534975.27
Apr410962411.34
Anil_Babu_Samineni

This will deserve

Sum({<[DataWeek] = {$(=Max([DataWeek]))}, Months = {'$(=Date(Max(Month(Date#(Months))),'MMM'))'}>} 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
Anil_Babu_Samineni

Or Change it to Months from Month name to Month number, That makes more clear like

Num(Month(Date#(Months))) as MonthNum


And, then expression should be this?

Sum({<[DataWeek] = {$(=Max([DataWeek]))}, MonthNum = {'$(=Max(MonthNum))'}>} 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
vikas_nandanwar
Creator II
Creator II
Author

Sum({<[DataWeek] = {$(=Max([DataWeek]))}, MonthNum = {'$(=Max(MonthNum))'}>} Qty)

And

Sum({<[DataWeek] = {$(=Max([DataWeek]))}>} Qty)

both gives me same output

When I select a single month, Out put is correct, but when all my month filters are open, It gives me sum of all entries from 4th Data week of all months.


Anil_Babu_Samineni

Where are you trying this? In text box / tabular report?

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

Text Box

Anil_Babu_Samineni

I believe should work if it is Text box? Can you show image in straight table with same expression and same in text box, Please?

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

Its Giving Me below numbers

 

MonthsDataWeekGrand Total
Jan489803.95
Feb492030.71
Mar478241.58
Apr490184.88
May488442.61
Jun490278.12
Jul495113.84
Aug491170.62
Sep491172.9
Oct492571.38
Nov490084.26
Grand Total989094.85