Extended filter function of date and condition

I am new and excuse my limited english. Iโ€™m building an inventory management system for vehicles. There is an Inventory table โ€œBestandโ€ with columns
[Source],[Date-1.EK],[Date-2.EK],[Date-EK],[Source2][Date-1.VK],[Date-2.VK],[Date-VK],

I have a filter with a start and end date. I would like to filter the date in the period and show lines depending on โ€œsourceโ€. My structure: FILTER (โ€œinventoryโ€,
AND ([Date-EK]> = [Filter-Start], [Date-VK]> = [Filter-Start], [Source] = โ€œOtherโ€,
OR ([Date-EK] <= [Filter-End], [Date-VK] <= [Filter-End], [Source.] = โ€œOtherโ€
)))

I get no further to determine that all dates are seen sorted and compared to โ€œsourceโ€. my simple formula is too inadequate and I couldnโ€™t find anything suitable in the help. I am really grateful for any help.

0 12 315
12 REPLIES 12

@Sven_Meissner
Ihre Formel ist semantisch nicht korrekt. Bitte versuchen Sie es damit:

FILTER(
	"inventory",
	(AND(
		"Other" = [Source],
		OR(
			AND(
				[Date-EK] >= [Filter-Start],
				[Date-EK] <= [Filter-Start]
			),
			AND(
				[Date-VK] >= [Filter-Start],
				[Date-VK] <= [Filter-End]
			)
		)
	)
)

thank you Levent for your help, but it doesnโ€™t work yet. I would like to explain the structure to you again. [Source] and / or [Source2] have as one of the values โ€‹โ€‹"other" for which the data records are to be filtered by start and end date. So the value โ€œOtherโ€ is in one of the two columns or in both at the same time. All date columns should be checked and filtered according to the start / end date. All date columns are: [Datum-1.EK], [Datum-2.EK], [Datum-EK],
[Datum-EKF], [Datum-Zuzahlung], [Datum-1.VK], [Datum-2.VK],
[Datum-VK], [Datum-Auszahlung], [Datum-Ablรถse], [Datum-1.Absch.], [Datum-2.Absch.], [Datum-3.Absch.], [Datum-4.Absch.], [Datum-5.Absch.].
So there is a date in the search area and "Other in (source) or (source2) or both, the line should be displayed. Thank you very much for your help and Iโ€™m really excited about Appsheet and the clever community

@Sven_Meissner
I have constructed the expression as per your given initial requirements in post#1. You need to list and filter all your date columns in the expression as per your needs inside the OR booelan:

FILTER(
	"inventory",
	(AND(
		OR(
			"Other" = [Source],
			"Other" = [Source2]
		),
		OR(
			AND(
				[Date-EK] >= [Filter-Start],
				[Date-EK] <= [Filter-Start]
			),
			AND(
				[Datum-1.EK] >= [Filter-Start],
				[Datum-1.EK] <= [Filter-End]
			),
			AND(
				[Datum-2.EK] >= [Filter-Start],
				[Datum-2.EK] <= [Filter-End]
			),
			AND(
				[Datum-EKF] >= [Filter-Start],
				[Datum-EKF] <= [Filter-End]
			),
			AND(
				[Datum-Zuzahlung] >= [Filter-Start],
				[Datum-Zuzahlung] <= [Filter-End]
			),
			AND(
				[Datum-VK] >= [Filter-Start],
				[Datum-VK] <= [Filter-End]
			),
			AND(
				[Datum-1.VK] >= [Filter-Start],
				[Datum-1.VK] <= [Filter-End]
			),
			AND(
				[Datum-2.VK] >= [Filter-Start],
				[Datum-2.VK] <= [Filter-End]
			),
			AND(
				[Datum-Auszahlung] >= [Filter-Start],
				[Datum-Auszahlung] <= [Filter-End]
			),
			AND(
				[Datum-Ablรถse] >= [Filter-Start],
				[Datum-Ablรถse] <= [Filter-End]
			),
			AND(
				[Datum-1.Absch.] >= [Filter-Start],
				[Datum-1.Absch.] <= [Filter-End]
			),
			AND(
				[Datum-2.Absch.] >= [Filter-Start],
				[Datum-2.Absch.] <= [Filter-End]
			),
			AND(
				[Datum-3.Absch.] >= [Filter-Start],
				[Datum-3.Absch.] <= [Filter-End]
			),
			AND(
				[Datum-4.Absch.] >= [Filter-Start],
				[Datum-4.Absch.] <= [Filter-End]
			),
			AND(
				[Datum-5.Absch.] >= [Filter-Start],
				[Datum-5.Absch.] <= [Filter-End]
			)
		)
	))
)

Thought havenโ€™t tried, another option could be this:

FILTER(
	"inventory",
	(AND(
		OR(
			"Other" = [Source],
			"Other" = [Source2]
		),
		AND(
			[Filter-Start] >= MIN(SORT(UNIQUE(LIST([Datum-1.EK], [Datum-2.EK], [Datum-EK],[Datum-EKF], [Datum-Zuzahlung], [Datum-1.VK], [Datum-2.VK], [Datum-VK], [Datum-Auszahlung], [Datum-Ablรถse], [Datum-1.Absch.], [Datum-2.Absch.], [Datum-3.Absch.], [Datum-4.Absch.], [Datum-5.Absch.])),FALSE)),
			[Filter-End] <= MAX(SORT(UNIQUE(LIST([Datum-1.EK], [Datum-2.EK], [Datum-EK],[Datum-EKF], [Datum-Zuzahlung], [Datum-1.VK], [Datum-2.VK], [Datum-VK], [Datum-Auszahlung], [Datum-Ablรถse], [Datum-1.Absch.], [Datum-2.Absch.], [Datum-3.Absch.], [Datum-4.Absch.], [Datum-5.Absch.])),FALSE))
		)
	))
)

It gives me data, but not the correct one yet. It does not take into account the columns / source) and (source2) and in some cases no date limitation. I checked all the information.
The second expression doesnโ€™t work. (Arithmetic expression '(([_THISROW-1]. [Filter-Start]> = MIN (SORT (UNIQUE (LIST ([Date-1.EK], [Date-2.EK], [Date-EK], [ Date)))) -EKF], [Date-Co-payment], [Date-1.VK], [Date-2.VK], [Date-VK], [Date-Payment], [Date-Replacement], [ Date-1st dec.], [Date-2nd dec.], [Date-3rd dec.], [Date-4th dec.], [Date-5th dec.])), โ€œFALSEโ€) )) <= MAX (SORT (UNIQUE (LIST ([Date-1.EC], [Date-2.EC], [Date-EK], [Date-EKF], [Date-Co-payment], [Date-1 .VK], [Date-2.VK], [Date-VK], [Date-Payout], [Date-Replacement], [Date-1.Dep.], [Date-2.Dep.], [Date -3.Absch.], [Date-4.Absch.], [Date-5.Absch.])), โ€œFALSEโ€))) 'has no valid input types)

I am not aware of your table structure, your column structure, where are you trying to set this expression, what data do you have in those source columns etc. Provided you donโ€™t give details, I cannot further comment.

I have to call it a day because itโ€™s very late for us tonight. Iโ€™ll try to give you more details tomorrow. Perhaps there is a possibility that I will turn off the app and you will get an in-depth look. I would like to thank you for the good help and your interest.

Hello LeventK. Happy New Year to you.

To my problem. The structure is as follows. Everything is on two tables, โ€œInventoryโ€ and โ€œFilterโ€. Itโ€™s about buying and selling vehicles. The columns [Source] and [Source2] determine whether they already have an invoice or whether they are still being issued. We differentiate between source with โ€œcar dealershipโ€ and โ€œotherโ€. The columns [Date-1.EC], [Date-2.EC], [Date-EK], [Date-EKF], [Date-copayment], [Date- 1.VK], [Date-2.VK], [Date-VK], [Date-Payout], [Date-Replacement], [Date-1.Dep.], [Date-2.Dep.], [ Date-3rd par.], [Date-4th par.], [Date-5th par.] Are all date columns. The filter that is to sort on the inventory table via Ref has [Filter start], [ Filter-End]. I have an enum on the filter with โ€œstill to be editedโ€ and โ€œaccountingโ€ differentiates which value of the sources. โ€œStill to editโ€ should have all data records from which sources โ€œotherโ€ and one of the date columns in the Are filter period.
With โ€œaccountingโ€ then the same with source โ€œdealershipโ€. The structure is then:

buying: [Source], [Date-1.EK], [Date-2.EK], [Date-EK], [Date-EKF], [Date-additional payment]

selling: [Source2], [Date-1.VK], [Date-2.VK], [Date-VK], [Date-Payout], [Date-Replacement], [Date-1.dec.], [ Date-2.dec.], [Date-3.dec.], [Date-4.dec.], [Date-5.dec.]

Thanks for your nerves

@Sven_Meissner
Sorry but your description of the problem is too confusing and I believe I couldnโ€™t be able to follow you either and lost. Thus:

  • Whatโ€™s that [Source] and [Source2] column values are? Are they ENUMs? What values they have?
  • Where is this REF column? Which table? Ref to which table, which column?
  • A second filter? This ENUM column has 2 values only? {"Still to be edited" , "accounting"}?
  • Please elaborate
  • This one is confusing reallyโ€ฆWhere the choise of selling/buying come from?

sorry for my imprecise language. Unfortunately my application is very extensive with a lot of columns, tables, and data. It would be unbelievable with screenshots. Therefore I try to describe and hope for your understanding. The google translation doesnโ€™t make it clearer.

The filter has an ENUM with the values โ€‹โ€‹"still to be processed" and monthly billing "(with which I would like to distinguish the source and source2)
and are located in the โ€œFiltersโ€ table.
also โ€œfilter startโ€ and โ€œfilter endโ€ and โ€œresultsโ€, โ€œresultsโ€ is column type type โ€œlistโ€ and element type โ€œREFโ€ with which I access the table โ€œinventoryโ€. All data that are filtered are in the table โ€œInventoryโ€.

โ€œInventoryโ€ has โ€œSourceโ€ and โ€œSource2โ€ and different date columns for payments made. both โ€œsourcesโ€ are enums with the value โ€œotherโ€ and โ€œdealershipโ€. The structure is in the table the source then down payments and final payments, everything for purchasing a car. In the sales area of โ€‹โ€‹the car again source2 and down payments and final payment. I would like to achieve this with the filter. (Filter all data records which have the sources โ€œOtherโ€ and any date is in the range of the filter date). Or!! (I filter all data records which have the sources โ€œcar dealershipโ€ and any date in the range of the filter date). I want to make my billing easier at the end of the month, so just find all vehicles that have any payment date in the month.

The suggestions you have made are working, but the date is not precise and not all relevant data records are filtered. If only one date column of the data set falls within the filter time, it should be filtered. We apologize again for the inconvenience. Iโ€™ve seen your work (such as the Number2Text app) and look up at you. Brilliant.

3X_7_d_7d4fa423ea07e6afa5ae0c50f2a93c7459ecfa78.jpeg

3X_1_f_1f1420f542c16d7c915099d348d716badb9bd8c9.jpeg

Top Labels in this Space