Expressions execute at each frame and there is no way to pass data from one frame to the next. The work-arounds depend on what it is that you’re trying to do.
If all you want to do is generate a static random position, you could do it this way:
seedRandom(index,true);
x = Math.floor(random(thisComp.width));
y = Math.floor(random(thisComp.height));
z = Math.floor(random(-300, 300));
[x,y,z];
Dan