I have this pivot table in one worksheet, and I want to write a query to select only those rows whose Logistic
is US
and whose values didn't change over the past 30 days and write it in another sheet of the same spreadsheet. Here is the link to the demo sheet with the pivot table and desired output. In the desired output sheet, I just manually pasted the filtered data by Logistic type US and looked up the EANs with the unchanged quantity for the past 30 days. So, the last date is 3/16/2023 that's why I considered the values from 2/16/2023.
I thought about comparing the value of each EAN
in the most recent date with the values from the last 30 days. So, here are the conditions for the query:
Logistic
column = USDate
column in the tablecolumn S
, which is for the date 3/2/2023
, because it has no dataCan you please help me modify a query in Google sheets to achieve this? This formula below simply won't work because of this column S that has missing values and is included in the last 30 days range. I only want an exception for this particular column.
=filter('pivot table'!A3:W;
'pivot table'!B3:B="US";
byrow(filter('pivot table'!C3:W;'pivot table'!C2:W2>max('pivot table'!C2:W2)-30);lambda(Σ;if(counta(Σ)=0;;and(countunique(Σ)=1;eq(counta(Σ);columns(Σ)))))))
Added formula to your output tab
:
=filter('pivot table'!A3:V;
'pivot table'!B3:B="US";
byrow(filter('pivot table'!C3:V;'pivot table'!C2:V2>max('pivot table'!C2:V2)-30);lambda(Σ;if(counta(Σ)=0;;and(countunique(Σ)=1;eq(counta(Σ);columns(Σ)))))))