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

Better formula statement than if for picking value

Is there a better statement than using if to select/display a value

I have data in rows like this:

Salesperson     Position

Joe                    Primary

Mary                    Split

I am using a text field to display the "Primary" salesperson.    Is there a better formula/statement than

if(Position='Primary',Salesperson,)

1 Solution

Accepted Solutions
MarcoWedel

missing brackets:

Only({<Position = {'Primary'}>} Salesperson)


hope this helps


regards


Marco

View solution in original post

8 Replies
srchilukoori
Specialist
Specialist

Did you try using Only(<Position = {'Primary'}>Salesperson)?

Not applicable
Author

THis comes up as an invalid formula

Not applicable
Author

I used

pick(match(Position,'Primary'), 'Salesperson') and the above "IF" statement.  Both return the value I want.   The problem is, it only returns the value if i pick "Primary" in a list box.  


I want this field to ALWAYS display the primary salesperson

srchilukoori
Specialist
Specialist

Please upload a sample of your application.

MarcoWedel

Hi,

to let the primary salesperson be displayed regardless of any selections, you could use this expression:

=Only({1<Position={'Primary'}>} Salesperson)

QlikCommunity_Thread_150065_Pic1.JPG

QlikCommunity_Thread_150065_Pic2.JPG

QlikCommunity_Thread_150065_Pic3.JPG

QlikCommunity_Thread_150065_Pic4.JPG

QlikCommunity_Thread_150065_Pic5.JPG

hope this helps

regards

Marco

MarcoWedel

missing brackets:

Only({<Position = {'Primary'}>} Salesperson)


hope this helps


regards


Marco

Not applicable
Author

Excellent - this works perfectly.

Thanks.

MarcoWedel

You're welcome

Regards

Marco