This formula does not seem to hold for Qatar for 2018.
Using "custom query" on that page, from Qatar to South Korea, gross exports is 14,636,653.41 and re-exports is 6,715.565 and the difference becomes 14,629,937.85, rather different than 11,634,808.54 figure above.
The difference is also seen for all exports as well. For example for World data, in trade summary, exports from Qatar is 73,895,198.63. Using the gross exports-reexports formula using data in custom query it is 84,288,458.433-2,717,519.906=81,570,938.53
I'd be grateful if you could provide me with a solution. Many thanks.