def __get_datasetname(d, filename):
    """
    Get the filename based on the dataset name in the metadata
    :param str filename: Filename.lpd
    :return str: Filename
    """
    try:
        filename = d["dataSetName"]
    except KeyError:
        logger_excel.info("get_datasetname: KeyError: No dataSetName found. Reverting to: {}".format(filename))
    return filename