Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
marcus_steggall
Creator
Creator

Slider, to exclude data values

Afternoon all, hope you're well.

So I have a dashboard showing client name, with revenue amounts, plus hours.

I've added a slider based on a min variable, so colleagues can select to remove clients less than a certain total.

For example, in the attached I have Whisper Power showing 349.50.

So when you move the slider to along to a minimum of 1000, this line should disappear.

But for some reason, even though the revenue goes to zero, the hours then change to say -1.00?

Any help, would be much appreciated.

1 Solution

Accepted Solutions
marcus_sommer

It's a rounding topic because your result isn't 5,000 else 4,999.9....:

but by including a roundig like the following it worked:

sum({<Client_Name={"=round(Sum(Revenue))>=$(min)"}>} Revenue)

More to this behaviour could you find here: Rounding Errors.

- Marcus

View solution in original post

6 Replies
marcus_sommer

I think your second expression should be look like:

sum({<Client_Name={"=Sum(Revenue)>=$(min)"}>} Worked_Hours)

- Marcus

sunny_talwar

It shows -1 because your true condition is this

if(sum({<Client_Name={"=Sum(Revenue)>=$(min)"}>} Revenue) = 0,

sum(Worked_Hours)=0,

sum(Worked_Hours))

and for this particular client Sum(Worked_Hours) = 0... which is true and true in QlikView is -1. What would you like to see?

boorgura
Specialist
Specialist

Just use this for hours expression:

if(sum({<Client_Name={"=Sum(Revenue)>=$(min)"}>} Revenue) = 0,

0,

sum(Worked_Hours))

marcus_steggall
Creator
Creator
Author

From one Marcus to another, good name

Many thanks, that was a quick and easy solution it seemed.

I have one concern, using this way that i've noticed.

From the attached qvd again, note i have this filtered on a particular client at an amount of 5,000

So if you move the slider along, from 4,000 to 5,000 this should remain.

But for some reason, it disappears!

Any idea, as it seems to do this for a handful of clients?

Nice one

marcus_sommer

It's a rounding topic because your result isn't 5,000 else 4,999.9....:

but by including a roundig like the following it worked:

sum({<Client_Name={"=round(Sum(Revenue))>=$(min)"}>} Revenue)

More to this behaviour could you find here: Rounding Errors.

- Marcus

marcus_steggall
Creator
Creator
Author

of course rounding

excellent, now this slider is working like a dream.

Many thanks pal, exactly what I required