I want to find every record that occurs at least two times. The result should be something like this
MyLineItem__c | Type__c | ItemValueString__c | Count |
---|---|---|---|
Foo | Boo | Booze | 2 |
Yal | Bal | Jazz | 2 |
Xul | Xal | Xray | 3 |
I tried this query
SELECT MyLineItem__c, Type__c,
ItemValueString__c, Count(Id)
FROM MyDetail__c
WHERE
CreatedDate > 2024-01-20T00:00:00.000Z
GROUP BY
MyLineItem__c, Type__c, ItemValueString__c
and got
INVALID_FIELD [object Object]: MyLineItem__c , Type__c, ItemValueString__c ^ ERROR at Row:1:Column:196 field 'ItemValueString__c' can not be grouped in a query call
The field ItemValueString__c
is encrypted
Based on What types of fields are groupable in a SOQL GROUP BY
clause? i assume that the encryption is the cause for the error message.
Questions
- How to handle encypted fields?
- What can be done to analyze these field?