Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Not applicable

Nesting Variables with parameters

I'm trying to pass the results of a variable with parameters to another variable having parameters but I can't quite get it to work.  I have this 2 variables which work when they are not nested.

eNetScenMV = Sum ({$<$(vMonthEnd), [Account Type]=, [Scenario]={$1}>} [#Market Value Usd])

     usage: $( eNetScenMV("PC1-") )

eSumOfSquares = sqrt( sqr($1) + sqr($2) + sqr($3) )

     usage $( eSumOfSquares(1, 2, 3) )

I need to use the results of eNetScenMV as parameters to eSumOfSquares like so in a TEXT object:

=$(eSumOfSquares($(eNetScenMV("PC1-")), $(eNetScenMV("PC2-")), $(eNetScenMV("PC3+"))))

When I do this I get an "Error in Set Modifier Expression".  I've tried a number of things but cannot get it to work.  I appreciate any help on this.

1 Solution

Accepted Solutions
Highlighted
Not applicable

Re: Nesting Variables with parameters

Nasario,

please try:

$(eSumOfSquares($(=$(eNetScenMV("PC1-"))), $(=$(eNetScenMV("PC2-"))), $(=$(eNetScenMV("PC3+")))))

View solution in original post

2 Replies
Highlighted
Not applicable

Re: Nesting Variables with parameters

Nasario,

please try:

$(eSumOfSquares($(=$(eNetScenMV("PC1-"))), $(=$(eNetScenMV("PC2-"))), $(=$(eNetScenMV("PC3+")))))

View solution in original post

Highlighted
Not applicable

Re: Nesting Variables with parameters

Thanks Dariusz Mielczarek this worked!  I'm still trying to understand this dollar expansion business .  Does the inner dollar expansion =$(eNetScenMV("PC1-") get the expression to be expanded by the outer $(...)?