Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis in calculated variable

Hi Guy,

I have a variable wich is set and calculated as Include statement in the script

vProject# = sum({$<[ForecastCategoryName] = {'Pipeline'},DateType = {'Snapshot Date'}>}[# Opportunity])

And the front end expression of the chart is defined as $(vProject#)

But now i have several dimensions like country and year which a want to slice and dice trough this calculation in the frond end

How do i write this properly?

sum({$<[Year] = {'2016'},($(vProject#)) will not work. Pls advice

Thanks!

Robbie

5 Replies
Anonymous
Not applicable
Author

Try this

$(=only({$<[Year] = {'2016'}>}vProject#)

Regards,

Greeshma

Anonymous
Not applicable
Author

Nope,

No resuls

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there,

First of all, your set analysis expression is wrong and invalid and it will return null. Try maybe, tweak it a bit like this:

sum({$<[ForecastCategoryName] = {'Pipeline'},DateType = {'Snapshot Date'}, [Year] = {'2016'} >} [# Opportunity])


With these you can do what you want


Regards,

MB

Anil_Babu_Samineni

Perhaps This

=sum({$<[Year] = {'2016'} $(vProject#))


OR For testing check this

Aggr(sum({$<[Year] = {'2016'} $(vProject#)),[ForecastCategoryName])

or

Would you able to provide sample

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
jonathandienst
Partner - Champion III
Partner - Champion III

No matter how you want to massage your expression

=sum({$<[Year] = {'2016'},($(vProject#))

you will not get that to work, as this a nested Sum statement which is not allowed.


You can go with miguelbraga‌'s solution above, or  you could try

=Sum({$<[Year] = {'2016'}>} Aggr($(vProject#), Year, chartdim1, chartdim2, ...))


Where chartdim1, chartdim2 is comma separated list of all (one or more ) the chart dimensions.

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