Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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

1 Solution

Accepted Solutions
Anil_Babu_Samineni

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

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

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

Glad it helped