 ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID"
 
 LEFT JOIN "TimeSeries" 
-ON "TimeSeries"."DataValuesMapperID"="DataValuesMapper"."DataValuesMapperID"
+ON "TimeSeries"."ValuesMapperID"="ValuesMapper"."ValuesMapperID"
 
 LEFT JOIN "TimeSeriesValues" 
 ON "TimeSeriesValues"."TimeSeriesID"="TimeSeries"."TimeSeriesID"


                                                   --The second SELECT statement (get the monthly data and keep it monthly)

SELECT DatasetAcronym,AttributeName, InstanceName,AggregationStatisticCV,IntervalTimeUnitCV,UnitNameCV,
YearType,strftime('%m/%Y', DateTimeStamp) as YearMonth, TimeSeriesValueID,count(value) As CountDays,






FROM ResourceTypes

Left JOIN "ObjectTypes" 
ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID"

-- Join the Objects to get their attributes  
LEFT JOIN  "Attributes"
