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

Check if value exists in field

Hi Folks,

I want to check if a value exists in a fild so I can display a message to users.

So my idea is to have a conditional show on a text object, something like this:

=if(FieldIndex('Payroll Detail Amount','blocked'),1,0)

However, fieldindex returns the index of the unfiltered position of the vlaue.  I am looking for a function that will return the index (or a TRUE or FALSE) on a filtered list.  EG, if the user has made selections and there are no records with a value of 'blocked' then return FALSE.

Many thanks for your help

George

1 Solution

Accepted Solutions
gandalfgray
Specialist II
Specialist II

Hi George

If I understand your case:

You want to return 1 if the user has a value "blocked" in  [Payroll Detail Amount] when all selections he has made is taken into account.

You can try this:

=count({<[Payroll Detail Amount]*={"blocked"}>} distinct [Payroll Detail Amount])

it will return 1 if blocked are among possible [Payroll Detail Amount] and 0 otherwise.

hth/gg

View solution in original post

3 Replies
gandalfgray
Specialist II
Specialist II

Hi George

If I understand your case:

You want to return 1 if the user has a value "blocked" in  [Payroll Detail Amount] when all selections he has made is taken into account.

You can try this:

=count({<[Payroll Detail Amount]*={"blocked"}>} distinct [Payroll Detail Amount])

it will return 1 if blocked are among possible [Payroll Detail Amount] and 0 otherwise.

hth/gg

gsbeaton
Luminary Alumni
Luminary Alumni
Author

I hadn't even crossed my mind to use set analysis.  Thank you for your help - this works perfectly.

George

Not applicable

Hello,

The solution given by GandalfGray is excellent. Even in my documents saved for later use.

Just for the study of QlikView would like to post a solution that usedin an application:

SUBSTRINGCOUNT ((';'& = CONCAT (DISTINCT FieldName,';')&';'),';'&$( VARIABLE )&';')

But as I said the solution is given by GandalfGray much better!

Hugs

Stive

Brasil