See image attached
in the settings for the menu item there is a condition field, that will allow you to enter your variable, in the image I have hidden the menu item "Category Course" by putting in the condition 2>3 which is not true even for very large values of two, so the menu item does not show.
K
[attachment deleted by admin]