You need to sign in to do that
Don't have an account?
Tomasz Jurek
MALFORMED_QUERY: duplicate alias: Email
Gentelmen I know you have more than free time for challenges like this
I have downloaded all metadata for reports and rep types
I have found one specific fields that is in there
Now I need to get all creators/modifiers of these reports
Doesn't matter that I hit SOQL character limit 20,000 which is really 4000 for WHERE CLAUSE I have more than 2000 lines and ~70000 - doesn't matter.
All I need is to get emails from creator or last modified but if I ran this query
I will get an MALFORMED_QUERY: duplicate alias: Email
I have went through ALIAS keywordk in SOQL & SOSL guide but without success.
I have downloaded all metadata for reports and rep types
I have found one specific fields that is in there
Now I need to get all creators/modifiers of these reports
Doesn't matter that I hit SOQL character limit 20,000 which is really 4000 for WHERE CLAUSE I have more than 2000 lines and ~70000 - doesn't matter.
All I need is to get emails from creator or last modified but if I ran this query
select CreatedBy.Email, COUNT(CreatedById), LastModifiedById from Report where DeveloperName IN (LOTS OF REPORTS BY DEV NAME, LOTS OF REPORTS BY DEV NAME) group by CreatedBy.Email, LastModifiedByIdAbove code works but if I want both emails fields I am interested in then I get
select CreatedBy.Email, COUNT(CreatedById), LastModifiedBy.Email from Report where DeveloperName IN (LOTS OF REPORTS BY DEV NAME, LOTS OF REPORTS BY DEV NAME) group by CreatedBy.Email, LastModifiedBy.Email
I will get an MALFORMED_QUERY: duplicate alias: Email
I have went through ALIAS keywordk in SOQL & SOSL guide but without success.
try this SOQL:
please marks as the best answer, if this help you!
regards,
Omar
All Answers
try this SOQL:
please marks as the best answer, if this help you!
regards,
Omar
True Omar I actually did something like that, on first try I actually hit some errors that is why opened this ticket.
Would you be able to help to improve this query by somehow only have 2 COUNT_DISTINCT on both emails in same query?
Sorry if I talk jibberish but too much coffe and this is EOD for me.
COUNT_DISTINCT()- returns the number of unique/distinct non-null field values in a query result
What do you think? Problem is with doing both fields with count_distinct in one query
Please let me know if this makes sense for you?
or?