Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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,)

Labels (1)
1 Solution

Accepted Solutions
MarcoWedel
MVP
MVP

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
MVP
MVP

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
MVP
MVP

missing brackets:

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


hope this helps


regards


Marco

Not applicable
Author

Excellent - this works perfectly.

Thanks.

MarcoWedel
MVP
MVP

You're welcome

Regards

Marco