Prepopulation is needed only if the actual data time range is not empty IF @MinTime IS NOT NULL AND @MaxTime IS NOT NULL ...

'

    -- Prepopulation is needed only if the actual data time range is not empty
    IF @MinTime IS NOT NULL AND @MaxTime IS NOT NULL
    BEGIN 
        -- Get current prepopulation date range
        SELECT @MinPopulationYear = PopulationStartYear, @MaxPopulationYear = PopulationEndYear 
        FROM [dbo].[bam_Metadata_PrepopulatedTimeDimensions]
        WHERE CubeName = N'
English
English (United States)
Deutsch (Deutschland)
German (Germany)
Español (España)
Spanish (Spain)
Français (France)
French (France)
日本語
Japanese
한국어
Korean