3 Replies Latest reply on Jun 18, 2018 5:03 AM by Simon Runc

# Dateiff with multiple criteria?

Hello there,

The challenge here consists of displaying how many days left of inventory we have on the orange bar chart.

I imagine it would follow these steps:

• Calculate sales for the last 90 days if Product Code is X;
• Divide current inventory by the result the aboe calculation.

I would like to know if this is possible having one Calculated Field only.

Thank you!

• ###### 1. Re: Dateiff with multiple criteria?

hi Antonio,

Let me know if the attached does what you are after?

If not, let me know where and why? If it does do the job, I can go into how I've done it (you might be able to work that out from the "How it works" tab.

1 of 1 people found this helpful
• ###### 2. Re: Dateiff with multiple criteria?

Hello Simon Runc!

Thanks for responding quickly. I got a ride with what you sent and decided to shift it a bit as follows:

Calculated Field:

Name: Last Date

Content: {MAX([DATAEMIS])}

Calculated Field:

Name: Last 90 Days

Content: 90

Calculated Field Isolating volumes sold in the last 90 days

Name: Volumes Sold in the last 90 days - ProductName

Content: {SUM(IF [DATAEMIS] >= [Last Date] - [Last 90 Days] THEN [Product Name] END)}

Calculated Field Dividing Inventory By What was sold in the last 90 days:

Name: Inventory Days on Hand - Product Name

SUM([Invetory - Product Name]) / sum([Volumes Sold in the last 90 days - Product Name]) * 100

This may help someone looking for answers alike.

Cheers,

Antonio

• ###### 3. Re: Dateiff with multiple criteria?

Nice work Antonio...and glad what I shared helped