Unique Values

configuration-examples Unique Values

This example shows how to read data from a .csv file and make a domain-unit with the unique values of an attribute.

example

container SourceData
{
   unit<uint32> indicators
   : StorageName     = "%SourceDataProjDir%/Indicators/datapacakage.csv"
   , StorageType     = "gdal.vect"
   , StorageReadOnly = "True"
   {
      attribute<string>           HeatOption; // HeatOption must be an attribute in the csv file 
      attribute<HeatOptionUnique> HeatOptionUnique_rel := rlookup(HeatOption, HeatOptionUnique/values);
   }

   unit<uint32> HeatOptionUnique := unique(indicators/HeatOption)
   {
      attribute<uint32> number := pcount(indicators/HeatOptionUnique_rel);
   }
}