Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
pauldamen
Partner - Creator II
Partner - Creator II

Set Analysis with variable

All,

I have 120 projects, I want to count the number of projects which are within budget. The sum is calculated as follows: Sum(Budget) - sum(Actuals)

I thought to make a set analysis in which a created a variable for the calculation of the difference:

Count({< '$(vProjectResult)' = {'>0'}>} [Project ID])

But whatever I try I can't get the variable to work in that place (I tried all kinds of quotes, brackets etc)

My question is, is this possible to create and if so how?

And if not what would be the best way for me to do this?

Regards,

Paul

7 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Did you try

Count({<$(=vProjectResult) = {'>0'}>} [Project ID])

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
pauldamen
Partner - Creator II
Partner - Creator II
Author

Hi,

Thanks for the reply Jonathan.

I did try that as well, but no luck.

Any other options?

Regards,

Paul

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Paul,

     If its possible for you to create a new field in script which will be Budget - Actuals

    

     Then it will be easier.

     All you need is

     Count({<Amount= {'>0'}>} [Project ID])

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
pauldamen
Partner - Creator II
Partner - Creator II
Author

Good idea!

My budget and Actuals come from 2 different sources though. How can I create one field in the script?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Create a another table which will have project wise Budget, Actual and the difference.

     Then link that with your project Master.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
pauldamen
Partner - Creator II
Partner - Creator II
Author

I created all the tables and added the expression to calculate the difference, but it says it is an invalid expression:

Sum([2013 Budget])+Sum([2014 Budget])+Sum([2012 Budget])-Sum(EACRem) as ProjectResult

Not applicable

try this

Count(if(vProjectResult >0, [Project ID]))

or try this

Count({<$(=vProjectResult) = {">0"}>} [Project ID])