def write_select_topics(topics_dict):
    """Create a string for a SELECT part of an SQL query for a fact table

    Given a dictionary key-value pairs, this function outputs a string to be
    used as part of an SQL SELECT section. This is meant to be used when
    flatenning a table, and the given dict should contain all Key-Title pairs
    of the fact table to be used.

    For more details: https://www.cbs.nl/-/media/statline/documenten/handleiding-cbs-opendata-services.pdf?la=nl-nl
    """

    string = ""
    for key, title in topics_dict.items():
        string += f"\n    , fct.{key} AS {title.lower().replace(' ', '_').replace('(', '').replace(')', '').replace('%', 'per').replace(',', '')}"
    return string