Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

can we use a variable in set analysis??? need help pleaseee????

Hi all,

can someone help me out with below issue please???????

sum({<xoptiontype_={'CALL'}>}(Nominal_Quantity*voption))  where voption is a variable???

because voption is a formula which is very complex consisting of many other variables in it so I stored it as a variable.

19 Replies
tresesco
MVP
MVP

You can Try with dollar expansion,  like:

sum({<xoptiontype_={'CALL'}>} Nominal_Quantity* $(voption)

Not applicable
Author

Hi Tresesco,

I tried the same but it doesn't work.I have attached my application for the same.here B is the table which has the expression net call=sum({<xoptiontype_={'CALL'}>} Nominal_Quantity* $(voption) )

and also  this voption =net option in the  A table

Please can you help??

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

It depends on how you have designed voption. Does it have a leading = sign? If so, then I suggest

sum({<xoptiontype_={'CALL'}>} Nominal_Quantity * (voption))

Otherwise

sum({<xoptiontype_={'CALL'}>} Nominal_Quantity * ($(voption)))

to ensure that the * applies to the whole expression in voption, not just the first term.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
brijesh1991
Partner - Specialist
Partner - Specialist

sum({<xoptiontype_={'CALL'}>}(Nominal_Quantity*$(voption)))

tresesco
MVP
MVP

I don't find a variable called - voption in your app. And if you trying to refer a column from other chart table, you won't be able to. You have to think of alternatives.

Not applicable
Author

Hi Tresesco,

the variable is present at the last,you can check it.

I am doing the below method:

I have taken an expression from my A table(net option) and made that as a variable (voption)and now trying to substitute that variable in the B table expression(net call)

tresesco
MVP
MVP

That is not a variable. However, had the reference been from same chart table the similar approach could have been done using Label. As I mentioned earlier you can't refer a chart table column from other chart/object.

sarvjeet
Contributor III
Contributor III

Hi,

voption is using buy/sell, strikeprice in defination . Add all refrenced dimentions in Table 'B'  .

Also use $(voption) instead of voption

This should work.

-Sarvjeet

Not applicable
Author

ok,

thanks a lot all of you,

I need the referenced columns as well else it will not work as its a calculated expression.learning!!