Extracting Range and time Unit from query. TODO: This has to be customizable in the future.