Hi Babu,
It's better to explain business logic you want to calculate, not just a syntax question. It look's like you are going to slightly wrong direction especially with *WHEN_REF_DATA=MASTER_DATA.
The script will be DM package? What about user scope settings?
Describe dimensions involved with members and properties
Describe logic
Provide BPC version... and SP
B.R. Vadim