Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error with expression

Hi,

A solution was kindly provided to us via the community which when selected just brough through a certain amount of properties meeting the following criteria:

This is on a serach string on a button entitled red properties. The criteria for red is any property with a value less than 4999:

concat({$ <[NPV Total]={"<-£4999"}>} Address, '"' & '|' & '"') & '"' & ')'

It worked to date but now with new data its showing one property as green when the button is selected. Please see attachment on what happens and then how its resolved - but we shouldnt have to additional bits to resolve.

Any help would be appreciated:

Chris

1 Solution

Accepted Solutions
rubenmarin

Hi Chris, I used this expression in 'RED NPV' button action:

=    '(' & '"' & concat({$ <Address={"=Avg([NPV Total])<-4999"}>} Address, '"' & '|' & '"') & '"' & ')'

View solution in original post

15 Replies
tresesco
MVP
MVP

With a sample qvw, the case could have been investigated with a little more ease. Could you share one?

Not applicable
Author

Afraid I can't as it will have senstive information in. Otherwise I would.

Chris

Not applicable
Author

Thanks. I have scrambled some of the fields.

Can I then remove the app from this post after its answered?

tresesco
MVP
MVP

Yes.

karolina_
Creator II
Creator II

You have 2 Neighbourhoods under the same address in your sample data - is that correct?
Button does selection on current selection ($) so result is different when you make selection for "Moss Vale".

Not applicable
Author

Hi Karolina,

Yes we have the same street in 2 of our areas. Falcon Drive is in Mountksip and then there is another Falcon Drive in Moss Vale.

Chris

karolina_
Creator II
Creator II

Sounds like you need AND on two diffrent fields.

Since you compare simple [NPV Total] maybe u can add flag in load script and count flags and use them in set analysis in app?

if([NPV Total]<=-5000,-1,if([NPV Total]>=5000,1,0)) AS Flag

Button would then select -1 in field Flag

or add variables vRed, vAmber, vGreen - in the button set vRed=1 and others as 0 and multiple your expressions:
=Count( {<[NPV Total]={"<-5000"}>} [Address])*vRed

=Count({<[NPV Total]={">=-4999<=4999"}>} [Address])*vAmber

=Count( {<[NPV Total]={">=5000"}>} [Address])*vGreen

Not applicable
Author

Hi Karolina,

Right.That make sense but not sure how to do this. How do we get the vRed, vAmber etc to work? Just copying and pasting your expression comes up with an error in the script saying vRed is a bad field name. Do we need to add something to the script?

Sorry if this is really silly question..still learning!

Chris