
Re: using a formula variable in set analysis
Roland Kunle Sep 3, 2012 4:12 PM (in response to Martha Thompson)Hi,
two things I recognized at a glance:
I miss some bracketsstuff at the end of your vPeerGroup; only a copy/paste  error through posting?
only({$<EmpPeerSeq={$(=min(EmpPeerSeq)) }>}) (or sth like that)
second:
Think, it should be with an equal sign, as you use a function in your variable
QtrSum_PeerGroup={'$(=vPeerGroup)'}
HtH
Roland

Re: using a formula variable in set analysis
Martha Thompson Sep 3, 2012 4:29 PM (in response to Roland Kunle )Roland, you are correct, cut/paste from Qlikview is lopping off part of my variable formula. Complete variable formula is:
only ({$<EmpPeerSeq={$(=min(EmpPeerSeq))}>} EmpPeerGroup)
I tried your suggestion and the suggestion from pgalvezt but it still doesn't evaluate the variable correctly. If I replace the variable with the formula it works correctly:
=sum({$<QtrSum_MetricID={B20}, QtrSum_PeerGroup={$(=only({$<EmpPeerSeq={$(=min(EmpPeerSeq))}>} EmpPeerGroup))}>} QtrSum_PA_Count)
I'm going to use this in multiple places so I'd like to be able to store the formula as a variable. I just can't seem to get the syntax correct.
Thanks.

Re: using a formula variable in set analysis
Cesar Accardi Sep 3, 2012 4:50 PM (in response to Martha Thompson)Hi,
You said the variable doesn't evaluate correctly when you put in the modifier expression, have you tried to create an expression with just the variable? Does it returns any values, I mean can you see the variable evaluation for each line you have in your chart?
Regards,
Cesar Accardi

Re: using a formula variable in set analysis
Martha Thompson Sep 3, 2012 9:18 PM (in response to Cesar Accardi)Hi Cesar,
Yes, I have tried to get my set analysis expression to work only using the variable but get no results. The variable returns a value when I place it in a text box by itself. The only place I can't seem to get it to work correctly is when I use it within a set analysis statement. This leads me to believe it is related to the syntax. I've tried all sorts of combinations and haven't found the "magic format".
Thanks.

Re: using a formula variable in set analysis
whiteline _ Sep 4, 2012 1:21 AM (in response to Martha Thompson)=sum({$<QtrSum_MetricID={"B20"}, QtrSum_PeerGroup={"=$(vPeerGroup)"}>} QtrSum_PA_Count)





Re: using a formula variable in set analysis
Pablo GÃ¡lvez Sep 3, 2012 4:13 PM (in response to Martha Thompson)Try this:
=sum({$<QtrSum_MetricID={'B20'}, QtrSum_PeerGroup={'$(vPeerGroup)'}>} QtrSum_PA_Count)
Hope Help you!

Re: using a formula variable in set analysis
Martha Thompson Sep 4, 2012 12:25 PM (in response to Martha Thompson)I found the answer to my problem. I needed to put an = in front of my variable value in the variable definition. Once I made this change to the definition of the variable my formula works correctly with the following format:
=sum({$<QtrSum_MetricID={B20}, QtrSum_PeerGroup={$(=vPeerGroup)}>} QtrSum_PA_Count)
Thanks for everyone's advice.

Re: using a formula variable in set analysis
Roland Kunle Sep 4, 2012 2:58 PM (in response to Martha Thompson)Hi Thompson,
never give up. Sometimes live is easy. I wasn't far away in my first post:
second:
Think, it should be with an equal sign, as you use a function in your variable
QtrSum_PeerGroup={'$(=vPeerGroup)'}
RR
