Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
harshalshah
Contributor II
Contributor II

I want unique records by each ap_cmpn_id for max(date_processed) by latest raws_imported

I used this formula but it seems not giving proper result for all companies instead few records missing eventhough count exist.

 

({<date_processed_ap_parts = {"$(=Max(date_processed_ap_parts))"}>}[ap_parts_import.rows_imported])

 

this formula working but not giving all the companies result

 

sum(aggr(FirstSortedValue([ap_parts_import.rows_imported], -date_processed_ap_parts),ap_cmpn_id))

 

 

 

Labels (1)
3 Replies
Vegar
MVP
MVP

There is not enough info to be sure what's wrong with your expression.

I assume  [ap_parts_import.rows_imported] is a measure without any set modifiers on date_processed_ap_parts field.

Set modifiers on date fields can be tricky sometimes as dates are often stored as dual and set analysis are per default string based. Try changing from max() to maxstring() and from double quotes to single I. Order to get your string.

({<date_processed_ap_parts = {'$(=MaxString(date_processed_ap_parts))'}>}[ap_parts_import.rows_imported])

 

This might be your issue and then this should solve your issue. If not then it could be something else. If so, then please explain a bit more around your problem.

harshalshah
Contributor II
Contributor II
Author

This formula working but not giving result for all the companies

 

sum(aggr(FirstSortedValue([ap_parts_import.rows_imported], -date_processed_ap_parts),ap_cmpn_id))

 

 

 

error.PNG

Vegar
MVP
MVP

Do you get any output if you apply your set on a simple expression. Try this?

({<date_processed_ap_parts = {'$(=MaxString(date_processed_ap_parts))'}>}minstring(date_processed_ap_parts))

 

It should give you the max date_processed_ap_parts value.