Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have suddenly gone blank when using set analysis and calculated variable.
In my document I have a variable that holds a calculated rate = vTheRate
Is it possible to combine this with set analysis in a text box?
Something Like :
{< Area=['Area51'}>}vTheRate
where only want to show the calculated rate for Area 51?
Thanks
You will need to alter you variable expression. This way isn't possible. What is the expression you are using for vTheRate?
For instance:
sum({< Area=['Area51'}>} [your measure]) * vTheRate
its just a simple
sum(number_sent)/sum(total)
its used many times throughout my document...
As long as you use some sort of aggregation function you can always use a set expression.
The set expression creates some constraints one which values from a specific field that will be included in your calculation. If there are more than 1 value returned after applying the constraints QlikView needs to know what to do with the multiple values - like sum, average and so forth.
You can even choose to make a string with a concatenated list of the values by using the Concat()-function that is actually a "text-aggregation"/pseudo-aggregation.
You should be able to do something like this:
Sum( {< Area={'Area51'}>} someField )
Sum( {< Area={'Area51'}>} someField * someOtherField )
And you can of course add "constraints"/field modifiers to be able to "drill" down your expression to specify exactly the values you need to be included.
Sum( {<Area={'Area51'},Type={'Ufo'},Year={"200*"}>} Sightings )
Try this for your variable vTheRate:
=Sum({<Area={'Area51'}>}number_sent)/Sum({<Area={'Area51'}>}total)
Hi
As far as my knowledge goes,Set analysis can only be performed on dimensions and not on variables.
if you really want to use the set analysis, use it inside the variable definition as the others have suggested .
hth
Sasi