I am working on a file with 2 related layers: Developments and Projects (1 to many relationship). The purpose is to track renewable projects in my country where one "Development" can contain several "Projects". This way I can track that Development Langa has 3 projects: Langa Solar Energy Facility, Langa Wind Energy Facility and Thezi-Langa Solar Energy Facility.
I have a calculated field in the Developments layer that returns the number of projects in each development by using the following expression:
relation_aggregate( relation:= 'Projects', aggregate:= 'count', expression:= "fid" ) I would like to add 2 extra fields that will do the same, but technology specific: one will count solar projects and the other will count wind projects according to the "technology_id" in the Projects layer. In the example described above for the Langa development, it would return 2 for the calculated field for solar and 1 for the calculated field for wind. Essentially, I want the functionality of the COUNTIF function of MS Excel.


