# Formula for items with no sales in last 30 days

I have a inventory application with a sales table.
My sales inline looks like this:

I would like to add slice to my sales table which will only show items that have not been sold in the last 30 days. Can anyone help me with the formula that should be put in this slice?

Welcome to the AppSheet community !

Please try slice filter as

DATE([Data])<TODAY()-30

2 Likes

I used your formula for my slice

and as a result slices shows sales from 3/14/2020 till 5/7/2021

on 3/14/2020 I recorded first sale in appsheet

so it looks like it shows all sales from 30 days ago from today (first one) till my first sale in appsheet.

it has be something more complicated because formula has to check if there was or was not sale in last 30 days for a particular item

Thank you. Your initial requirement stated

Does the suggested formula satisfy the above condition? Items not sold in last 30 days means items sold before 30 days, right?

1 Like

OK my bad. items with NO SALES in last 30 days

1 Like

Thank you. Please update what table sales inline table references and do you wish to have slice on that referenced (or parent) table?

1 Like

Please update what table sales inline table references
I do not understand that

do you wish to have slice on that referenced (or parent) table?
slice

You mentioned Sales Inline table. Could you please elaborate what you mean by â€śSales Inlineâ€ť? In AppSheet terms this generally means a child table that references a parent table.

Also in general, if you wish to show all the items that have not been sold in last 30 days, I believe one will need a list of all items, that typically exists in the inventory table.

1 Like

I have:

• product table
• sales table
• returns table
• purchases table

â€śsales inlineâ€ť in my case is a system generated table which reference to sales table

in sales table I am recording all sales with data and product name, like on the screen in previous message

Also in general, if you wish to show all the items that have not been sold in last 30 days, I believe one will need a list of all items, that typically exists in the inventory table.

yes thatâ€™s correct so this slice should reference to product table?

Yes

1 Like

ok great, any clue how the formula should looks like?

I believe it will be more than a formula. I believe you may need to consider what is called as referencing in Appsheet ( to interconnect two or more tables) and also please take a look at few inventory sample apps.

https://www.appsheet.com/Support?q=Inventory&hPP=10&idx=help&p=0&dFR[doc_type][0]=Apps&is_v=1

1 Like

yes I know what is reference between table is. I have already use it in my app. Problem is that I do not have any idea how to bait it. Thanks anyway!

Great. Then you will be able to reference between Sales and Products and pull information from Sales into Product to get the desired sales details for last 30 days.

1 Like