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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Stock history, no zero stock values in datatable

 

Hi Experts

I have a Problem with my inventory report. The report is showing the current inventory and by date selection also the inventory Level from the past. The inventory data is updated from the ERP every day, the history is stored every week and every month end. To reduce the data volume Zero stock values, won’t be updated.


To avoid that the figures by item gets cumulated, im using this Expression, which is checking for the last file, within the date selection. If an item has no records on the specific date, the value Zero will be used (no item in database, means stock 0)

alt(sum({<Date={'$(vInventoryMaxDate)'}>}#InventoryOnHand_EUR),0)

 

This is the variable which i use to get the date, from the last inventory update, according to the date selection

=MaxString ({$<#InventoryOnHand+={1}>}Date)


The report now works fine, as long i have at least 1 item with a record on the date selection. If i select just a single item, which currently has stock Zero, the expression will go back to the last record and Show me that value. Let’s say i like to see the stock of the 22.09.2015, and the value should be 0, it will automatically go back to the 31.07.2015 which is the last record of the item, and Show me that stock (8pcs.).


I have attached a sample qvd. for better Explanation, i have already selected a item which is suppose to Show Zero.



is it possible to ignore the selected item in the variable? If i get from the variable the value 22.09.15, then the Expression above will automaticlly Show 0 as result.


Many thanks for help

 

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe just change your variable definition to

=MaxString ({$<#InventoryOnHand+={1}, %Item=>}Date)

View solution in original post

2 Replies
swuehl
MVP
MVP

Maybe just change your variable definition to

=MaxString ({$<#InventoryOnHand+={1}, %Item=>}Date)

Anonymous
Not applicable
Author

Perfect,it works

Many thanks!