my sort changes once i add a date in the filter. if i remove the date from the filter the sort shows the latest by date created when i add the date to the filter is sort change to QC_LOT_NUMBER ascending and Date Created Descending. ive removed everything except the date but same issue.
does anyone know how i can resolve this issue?
SortByColumns(
Filter(ZZQCLTS
,StartsWith(QC_LOT_NUMBER,LotSearch.Text)
,StartsWith(PART_NUMBER,PartNumSearch.Text)
,StartsWith(COMMERCIAL_PART_NO , CommerialPartSearch.Text)
,If(!IsBlank(DatePicker1.SelectedDate), DateValue( DATE_MANUFACTURED,"EN-us") = DatePicker1.SelectedDate , true)
), "DATE_CREATED", Descending)
Hi @agonciulea ,
The code below (slightly modified) should certainly sort by DATE_CREATED descending - are you saying it does not?
SortByColumns(
Filter(
ZZQCLTS,
StartsWith(QC_LOT_NUMBER,LotSearch.Text),
StartsWith(PART_NUMBER,PartNumSearch.Text),
StartsWith(COMMERCIAL_PART_NO,CommerialPartSearch.Text),
(IsBlank(DatePicker1.SelectedDate) || DateValue(DATE_MANUFACTURED,"EN-us") = DatePicker1.SelectedDate)
)
),
"DATE_CREATED",
Descending
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Unfortunately that didnt work
here are the result with out the date filter
here are the results with the date filter
here is the formula, i did change the !IsBlank to IsBlank but
Sort(
Filter(
ZZQCLTS,
StartsWith(QC_LOT_NUMBER,LotSearch.Text),
StartsWith(PART_NUMBER,PartNumSearch.Text),
StartsWith(COMMERCIAL_PART_NO, CommerialPartSearch.Text),
(IsBlank(DatePicker1.SelectedDate) || DateValue(DATE_MANUFACTURED, "EN-us") = DatePicker1.SelectedDate)
),
DATE_CREATED,
Descending
)
Hi @agonciulea ,
Your code
Sort(
Filter(
ZZQCLTS,
StartsWith(QC_LOT_NUMBER,LotSearch.Text),
StartsWith(PART_NUMBER,PartNumSearch.Text),
StartsWith(COMMERCIAL_PART_NO, CommerialPartSearch.Text),
(IsBlank(DatePicker1.SelectedDate) || DateValue(DATE_MANUFACTURED, "EN-us") = DatePicker1.SelectedDate)
),
DATE_CREATED,
Descending
)
has to sort on DATE_CREATED, descending if your filter returns data and DATE_CREATED is a Date/Time field in your List ZZQCLTS. Your images show Lot Number - how do you know it is not sorting by date?
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi WarrenBlez,
here is a screenshot with and without the date formula in the filter
Without Date in Filter With Date in Filter
Hi @agonciulea ,
What is your data source here ? If it is Excel, then your dates are Text (I see you already have converted several) and the sort is correct. Try this (Note you can only work with record numbers returned from the top filter up to your Delegation limit)
With(
{
wList:
Sort(
Filter(
ZZQCLTS,
StartsWith(QC_LOT_NUMBER,LotSearch.Text),
StartsWith(PART_NUMBER,PartNumSearch.Text),
StartsWith(COMMERCIAL_PART_NO, CommerialPartSearch.Text)
)
)
}
Sort(
AddColumns(
Filter(
wList,
(IsBlank(DatePicker1.SelectedDate) || DateValue(DATE_MANUFACTURED, "EN-us") = DatePicker1.SelectedDate)
),
"DateSort",
DateValue(DATE_CREATED)
),
DateSort,
Descending
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi @agonciulea ,
Your dates are Text if you have to convert them with DateValue() - did you try the code I posted?
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi @WarrenBelz
unfortunately the code above did not work. it just errors out.
I have been able to determine its a Date filed issue. If i do a Text() , DateValue() or a Startwith() the sort breaks, but if i do a Date with no formating it appears to work correctly. but now i cant seem to get the datepicker do work correctly or with filter the date.
Hi @agonciulea ,
As I mentioned, I am not an SQL user, but this document may be of assistance to you.
User | Count |
---|---|
252 | |
107 | |
90 | |
51 | |
44 |