How do I create an expression to count the number of unique values?
I have data showing new homes built in a subdivision, want report to count the number of unique homebuilders.
0
-
Hi @Ethan Granger?,
I was able to implement this with a c# script using GR5 On-Premise. My print template counts the number of features and also unique user names.
View from the Designer:

Output PDF:

The documentation for creating scripts is here:
https://docs.geocortex.com/reporting/latest/help/Default.htm#rpt5/help/scripting.htm
Script for this report:
using System; using System.Collections; using System.Collections.Generic; using System.Runtime.Serialization; HashSet<String> uniqueUsers = new HashSet<String>(); private void Detail1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { uniqueUsers.Add(GetCurrentColumnValue("created_user").ToString()); } private void label9_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { label9.Text = uniqueUsers.Count.ToString(); }Edit: Added more detail.
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
1 commentaire