Sorry to bother you on a Saturday, but i need some help This is a two part question, so please be patient .I have created a fieldset on the account object called “HistoryTracking”.
1) I would like to count how many times the fields within the fieldset “HistoryTracking” is not null 2) count how many times there is a field
So For example in my sandbox, i have created four accounts. The field website is populated three out of four accounts Desired results;
Field :Website Populated :3 Total count : 4 I have wrote the following below( which more than likely wrong as my first time writing an aggregate query) but as you can see i have hardcoded “Website” Into the query. I have approx 10 fields in the fieldset and i don’t want to manually hard code these into the query
AggregateResult[] ARs
= [SELECT count(Id) myCount, website
FROM HistoryTracking
GROUP BY website];
Looking forward to your response