I am wondering in which situation, why, we use "$", and what's the advantage of using it. Please it will be really helpful. if someone gives me a good explanation.
In QlikView a dollar-sign is used in 2 situations:
Dollar-sign expansion: if you need to insert the result of a variable that is represented as an expression, then you would enclose that variable in $(variable). For example, if your variable contains a formula day(today()) then in order to evaluate that formula you would need to use dollar-sign expansion. By contrast, if your variable contains a static value (e.g. 1) then you can just express this by writing the variable without dollar-sign expansion. The equivalent in the script is "LET" when defining a variable, while "SET" will define a variable with a static value.
The dollar sign is also used in set analysis to represent the set of user selections. This is the default set in QlikView. For more on this, search for "set analysis" in the QV help file.