Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a variable that I sometimes want to use set analysis on (but not always).
I want to be able to use it as it is - i.e:
=$(sum_num)
--> would calculate sum(num)
or, alternatively use a parameter to pass a set analysis expression
=$(sum_num({<country={'US'}>}))
--> would calculate sum({<country={'US'}>} num)
_______________
What I've tried so far:
sum($1 num)
gives errors when I don't pass any variable (works great for =$(sum_num({<country={'US'}>})) though)
I've also tried
sum(if(NOT isNull($1),$1) num)
and
sum(alt($1,'') num)
But neither of those are working.
Any ideas?
Thanks
I found a work around. SET SumNum = sum({<$1>} num) works with =$(SumNum(Country={'US'})). It gives a bit of an ugly result (sum({<$1>} num)) if you don't give any parameter, but it works.
Your variable value should be
='Sum($1 num)'
then try this in text object or chart expression
=$(sum_num({<country={'US'}>}))
Hi
Try this (not tested) - Sum(If(Len('$1')=0,{$}, $1) num)
HTH
Jonathan
Thanks, but it only works for
=$(sum_num({<country={'US'}>}))
not for
=$(sum_num5)
Doesn't work unfortunately. Good idea regarding {$} though - I'll experiment a bit with that
Did you try
=$(sum_num5())
Hi,
to use with setanalysis
=$(sum_num({<country={'US'}>}))
without set analysis use
=$(sum_num({$}))
May this approach might helps
I found a work around. SET SumNum = sum({<$1>} num) works with =$(SumNum(Country={'US'})). It gives a bit of an ugly result (sum({<$1>} num)) if you don't give any parameter, but it works.