convert – Issues with converting JSON to CSV with nested values

So far I have had no problems converting standard JSON to CSV with jq in the past. But now my data becomes complicated.

Major base tags are “account” and “subaccount”. All other values are variables. The entry “year” got variable values and changed by time very often. That’s my task I can’t solve.

Here is the output

    "jsonrpc": "2.0",
    "result": {
        "current": [{
            "number": 889325,
            "commission": 0,
            "year": [
                [1999, 431966, 0],
                [2000, 863966, 431966],
                [2001, 1295966, 863966],
                [2002, 1727966, 1295966],
                [2003, 2159962, 1727966],
                [2004, 9196409, 8963753]
            ],
            "status": true,
            "last": 9753768,
            "account": "VFUIJOPQW",
            "subaccount": "BLPORDGS"
        }]
    "id": 1
}

I think I have to add two additional columns for the last values of the year column as each year hast it’s own specific values. But I don’t know how.

"year": [
                [1999, 431966, 0],
                [2000, 863966, 431966],
                [2001, 1295966, 863966],
                [2002, 1727966, 1295966],
                [2003, 2159962, 1727966],
                [2004, 9196409, 8963753]
            ],```