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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Fabien
Contributor III
Contributor III

If Expression Else display N/A

Hi there,

I am failing to understand why my expression doesn't work here and hope someone can help me.

=If(count(GetFieldSelections([Week Num]))=0,Week(Today())-1,if(count(GetFieldSelections([Week Num]))=1,GetFieldSelections([Week Num]),'-'))

When multiple week numbers are selected [Week Num], it shows the following while i would like to show '-' or N/A (whatever is easier):

clipboard_image_0.png

1 Solution

Accepted Solutions
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Instead of GetFieldSelections, try GetSelectedCount.

View solution in original post

2 Replies
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Instead of GetFieldSelections, try GetSelectedCount.
Fabien
Contributor III
Contributor III
Author

That worked! Thank you @Arthur_Fong 

Final code if it can help anyone:

=If(GetSelectedCount([Week Num])=0,Week(Today())-1,if(GetSelectedCount([Week Num])=1,GetFieldSelections([Week Num]),'Multiple Selection'))