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

Set Analysis - Gone Blank

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

6 Replies
sunny_talwar

You will need to alter you variable expression. This way isn't possible. What is the expression you are using for vTheRate?

Michiel_QV_Fan
Specialist
Specialist

For instance:


sum({< Area=['Area51'}>} [your measure]) * vTheRate

Not applicable
Author

its just a simple 

sum(number_sent)/sum(total)

its used many times throughout my document...

petter
Partner - Champion III
Partner - Champion III

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 )



sunny_talwar

Try this for your variable vTheRate:

=Sum({<Area={'Area51'}>}number_sent)/Sum({<Area={'Area51'}>}total)

sasiparupudi1
Master III
Master III

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