Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

"Greater than" operator in data messing up if-logic

Hello Fellow Qlikviewers,

Here's a simple question: how can I fix the following formula, where I have the value ">5%" in my dataset.

count(if(Revenue = '>5%' ,Client))

Having the "greater than" operator in my dataset is probably the cause of this issue. 

Any help will be greatly appreciated.

6 Replies
swuehl
MVP
MVP

Not sure if I understand, seems to work for me.

Could you upload a small sample QVW that demonstrates your issue?

Not applicable
Author

Hi,

The formula does not generate an error message, but the result is 0 when it should be more than that.

Thanks.

kuczynska
Creator III
Creator III

What is the format of Revenue field? As Swuehl mentioned before me, can you upload a sample qvw?

If your Revenue field is in text format in the load script, you can always try to use combination of replace() and num() functions to bring it back to the numerical format, which should be way easier and faster to use in the frontend.

Did you try to change your expression to:

if(Revenue = '>5%' , count(Client) )


Not applicable
Author

Below is what the dataset looks like.

count(if(Revenue='>5%', Client))

I would expect this formula to come up with a value of 2, but it's coming out as 0.

Any ideas?  Thanks

   

ClientRevenue
ABC>5%
DEF0%to5%
GHI0%to-10%
JKL<-10%
MNO>5%
PQR0%to5%
swuehl
MVP
MVP

Is Revenue really a field in your data model or an expression in a chart?

Could you post a small sample QVW that demonstrates your issue?

Have you checked that the value does not contain additional characters, like spaces?

qlikviewwizard
Master II
Master II

Hi Trung,

Please attach the sample application to demonstrate your issue.Thank you.