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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can I add dimension to expression

Hi,

I am trying to create counter for a number of projects that have spent value under the budget. I decided to use a Text Object for this.

When I do it as a Table Chart, then I can get the number by Summing up the result (3 in the example).

ProjectBudgetSpentResult (1= under, 0=over)
1100501
250600
3200101
4150351
TOTAL5001553

But how can I add it to one expression?

When I use if((Sum(Budget)-Sum(Spent))>0,1,0) in the table it works just fine, but in Text object QV will not know what budgets and spent go together.

Sum(Budget)-Sum(Spent) will give 345 and I cannot count the projects.

Thank you in advance!

Mariliis

10 Replies
pat_agen
Specialist
Specialist

hi,

yes it may well be especially if the budget and spent values are coming from the different load.

Try this variation which should get round this:

=sum(if(aggr(Sum(budget)-sum(spent),project)>0,1,0))

I didn't try this first time round as I didn't think it would work but have tried on my dataset and it works whereas the first solution I gave you does not.