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: 
helen_pip
Creator III
Creator III

Null values with Substring(concat statement

Dear Qlikview User

I have attached a copy of a QVW which illistrates my issue

In the text object I have written an expression which should show 0 when Month Yr is not selected from list box.  However I expected the expression to be 0 when I take off all my selections from the list box

Could someone kindly take a look and let me know where I may have gone wrong with the expression as I would like the expression to show 0 when nothing in the list box is selected

Kind Regards

Helen

Labels (1)
1 Solution

Accepted Solutions
Anil_Babu_Samineni
MVP
MVP

Perhaps this?

=If(GetFieldSelections(_dates_RTT)='Month Yr',SubStringCount(Concat(If(IsNull(_dates_RTT), '1', _dates_RTT),  '|'), 'Month Yr'),'0')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

5 Replies
Anil_Babu_Samineni
MVP
MVP

Perhaps this?

=If(GetFieldSelections(_dates_RTT)='Month Yr',SubStringCount(Concat(If(IsNull(_dates_RTT), '1', _dates_RTT),  '|'), 'Month Yr'),'0')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
helen_pip
Creator III
Creator III
Author

Brilliant

Thank you, this works a treat!

Kind Regards

Helen

sunny_talwar
MVP
MVP

Or this

=If(GetSelectedCount(_dates_RTT) > 0, SubStringCount(Concat(If(IsNull(_dates_RTT), '1', _dates_RTT),  '|'), 'Month Yr'),'0')

If you want to see 1 if two selections are made and one of them is Month Yr

Capture.PNG

helen_pip
Creator III
Creator III
Author

Thanks Sunny

That was going to be my next question, this works for me

Kind Regards

Helen

sunny_talwar
MVP
MVP

Glad it helped