Skip to main content

Industrial Classification

Codes in Explore#

Explore can be used with NAICS and NACE codes.

Since the standards are not always the same in all databases we've to manage what the user will see, making sure it is always possible to recognize the codes from each other on the screen.

During the rendering phase of codes, or a graphQL call that includes codes, we must use a util function to filter some chars.
For example, since NACE and SIC codes have both 4 digits, we've to distinguish the codes from each other by always using a . in the NACE.

Since we only have the length to distringuish the codes, we must use that.

export const formatCodes = (codes: string[], destination: "FE" | "BE") =>  codes.map((code) => {    // nace for BE    if (destination === "BE" && code.length === 5 && code.includes(".")) {      code = code.replace(".", "");    }
    // nace for FE    if (destination === "FE" && code.length === 4) {      code = code.slice(0, 2) + "." + code.slice(-2);    }
    // naics do not change    return code;  });