Hello Luo Yong,
this will not work with OLAP selection references because you only get elementnames and levelnames.
For data retrieval you need to create a connection with dependencies to your hierarchies.
After that you could realize your Onclick requirement with help of the REFERENCE formula.
In your example the trigger would be the Onclick Event of the clicked product (rice ,milk etc.)
CURRENTROW will return the rowindex of the clicked object. Now you could loop through the columns in your row.
[OBJResult] := REFERENCE ( [OBJYourTable] ; 2 ; CURRENTROW ( ) )
Continue with your conditions like "If the result is empty continue with the next column" etc..