Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
thanhphongle
Creator II
Creator II

not expression in if expression

This is my database

ProductStatus

Notebook

Broken

Notebook

Broken

Notebook

Broken

Notebook

Stolen
NotebookBorrowed
CellphoneBroken

Cellphone

Broken
CellphoneBroken
CellphoneSold
CellphoneIn used

I want QV to return in a Textbox

Broken Products = 6

Not Broken Products = 4

I used this as expression

if(Status='Broken', count(Product))

if(Status=<>'Broken', count(Product))

Unfortunetely it is not working. Is there a solution with if expression and set analysis?

1 Solution

Accepted Solutions
sunny_talwar

Try this:

1) Count({<Status = {'Broken'}>}Product)

2) Count({<Status -= {'Broken'}>}Product) or Count({<Status ={'*'} - {'Broken'}>}Product)

View solution in original post

12 Replies
sunny_talwar

Try this:

1) Count({<Status = {'Broken'}>}Product)

2) Count({<Status -= {'Broken'}>}Product) or Count({<Status ={'*'} - {'Broken'}>}Product)

trdandamudi
Master II
Master II

May be as below:

=Count( {<Status={'Broken'}>}Product)

=Count( {<Status - ={'Broken'}>}Product)

Digvijay_Singh

Try this -

='Broken Product = ' & Count({<Status={'Broken'}>}Product) & chr(13) &

'Not Broken Products = ' & Count({<Status-={'Broken'}>}Product)

mightyqlikers
Creator III
Creator III

PFA.

$@M.

sunny_talwar

Sample attached

Capture.PNG

thanhphongle
Creator II
Creator II
Author

Thank you for the solution. Is there a solution with an IF- Expression?

sunny_talwar

Like this:

1) Count(If(Status = 'Broken', Product))

2) Count(If(Status <> 'Broken', Product))

sunny_talwar

Updated sample. But I am curious to know why do you want to use if rather than set analysis here? Any specific reason here?

Digvijay_Singh

Set expression will give better performance as it works with reduced set of records