Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
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