code: def create_absolute_values_structure(layer, fields):
      
      # Let's create a structure like :
      # key is the index of the field : (flat table, definition name)
      source_fields = layer.keywords['inasafe_fields']
      absolute_fields = [field['key'] for field in count_fields]
      summaries = {}
      for field in source_fields:
          if field in absolute_fields:
              field_name = source_fields[field]
              index = layer.fields().lookupField(field_name)
              flat_table = FlatTable(*fields)
              summaries[index] = (flat_table, field)
      return summaries
docs: Helper function to create the structure for absolute values.
  
      :param layer: The vector layer.
      :type layer: QgsVectorLayer
  
      :param fields: List of name field on which we want to aggregate.
      :type fields: list
  
      :return: The data structure.
      :rtype: dict