Can you help me build this view?

Hi.

I’m facing a problem with a view I need to make here and I’m not used to Domino development, I’m more an Administrator then a Developer.

So this problem may be quiet easy for you guys.

I have a form with 2 fields, the name of the customer and the date of the purchase.

I need to build a view that shows all the customers that have bought from us in 2007 and that have not bought from us in 2008.

I’ve tried some things here but without success.

Can you help me?

Thank you so much!

Subject: here you go

In the designer, open the view and goto View Selection (left bottom in pane).

here you make your selection.

SELECT FORM = “yourformname” & @Year(yourDateField) = 2007

et voila, set your columns next

Subject: but…

Thanks for the quick answer!

But with this I’ll see the customers that bought from us in 2007.

I need to see customers that bought in 2007 and that haven’t bought in 2008.

Customers that bought in 2007 and in 2008 again, I don’t want to see in this view.

Subject: Selections consider documents in isolation

View selections consider documents in isolation - that is when determining if a document is in a view or note, Notes can only consider what data is stored in that document alone.

Notes cannot build views that match your criteria.

So you need to store what years the customer bought from you in every document, and then use that information in the view selection.

i.e. In the QuerySave event of the form, lookup all years for that customer from other records (via a view) and combine that with the current record. Then you’ll need to put that value into all records for that company if their value is different.

Have a view by customer and year.

In QuerySave, use a DBColumn to return all years from other document

Append the year from the current document

Remove any duplicate values

For all other documents for this customer, if their value does not match the new value, modify them.

Alternatively, if this information is required for reporting, rather than users interacting with your database, export the data to a reporting tool, and do the analyses there.