11 Replies Latest reply: Jan 4, 2015 1:12 PM by ISHFAQUE AHMED RSS

    string funtions

      hi QV,

       

      Can any have complete explanation on string Functions with examples .plzzz help me out with this

       

      -lohi

        • Re: string funtions
          Jonathan Poole

          from the qlikview help select 'index' tab and type:  string functions and you'll get the list.

           

          you need to install qlikview Personal edition first.

           

          since its all public , here is a PDF extract from the help of the same

          • Re: string funtions

            Well if you could tell me what you want to do I could sourly help you!

              • Re: string funtions

                ya sure my requirement is ,

                 

                1. we have a variable and field with string .

                2.it should check the whole field what we have enter in "Input Box"

                3.if that is not there it should show Null if it there it should Compare with Sales or some other fields which we mention in for loop

                 

                plz sort me out of this problem

                 

                -lohi

                  • Re: string funtions
                    Jonathan Poole

                    substringcount is 1 way.  Just replace your field below where i have fieldname and replace vVariableName with your variable name and 'compare with sales' with the rest of your expression.

                     

                    if (  substringcount(  [FieldName] , $(vVariableName) )  > 0 ,  ..compare with sales...,  null())

                      • Re: string funtions

                        1. we have a variable and field with string .

                        2.it should check the whole field what we have enter in "Input Box"

                        3.if that is not there it should show Null if it there it should Compare with "Sales" or some other fields which we mention in" for loop"

                         

                        plz sort me out of this problem

                         

                        -lohi

                          • Re: string funtions
                            Jonathan Poole

                            It sounds a lot like what a user gets when they type in a search text in a search box against all fields... they will see every data value in every field in the whole data model that matches their typed in value .

                             

                            Otherwise to check if the inputed string is in ANY of the data values for a given field you can try concat( distinct )  to check.   Modified sample as follows...

                             

                            if (  substringcount(  concat( distinct [FieldName] ,';')  , $(vVariableName) )  > 0 ,  ..compare with sales...,  null())


                            for the 'compare with sales'  you would need a nested IF statement to select other fields, but that could get slow and inefficient.

                    • Re: string funtions
                      Deepak Tibhe

                      len(string) Returns the length of

                      a string.

                      len('QlikView') 8

                      left(string,

                      number of

                      characters)

                      Starting from the left

                      of the string, returns

                      the specified amount

                      of characters.

                      left('QlikView', 4) Qlik

                      right(string,

                      number of

                      characters)

                      Starting from the

                      right of the string,

                      returns the specified

                      amount of characters.

                      right('QlikView', 4) View

                       

                      mid(string,

                      starting

                      character,

                      number of

                      characters

                      (optional))

                      Returns a substring

                      from the string,

                      starting at the

                      specified character.

                      Optionally, the

                      length of the

                      substring can be

                      specified. If no length

                      is specified, the

                      right-most part of the

                      string (starting at the

                      specified position) is

                      returned.

                      mid('QlikView', 5,

                      2)

                      mid('QlikView', 5)

                      Vi

                      View

                      index(string,

                      substring,

                      occurrence

                      (optional))

                      Returns the

                      position at which

                      the substring is

                      found in the string.

                      If an occurrence is

                      specified, QlikView

                      will look for that

                      specific occurrence,

                      otherwise the

                      first occurrence

                      is assumed. If a

                      negative number

                      is supplied for

                      occurrence, QlikView

                      starts searching from

                      the end of the string.

                      If no match is found,

                      the function returns

                      0.

                      index('QlikView',

                      'i')

                      index('QlikView',

                      'i', 2)

                      index('QlikView',

                      'i', -1)

                      3

                      6

                      6

                      upper(string) Converts the string

                      to upper case.

                      upper('QlikView') QLIKVIEW

                      lower(string) Converts the string

                      to lower case.

                      lower('QlikView') qlikview

                      capitalize

                      (string)

                      Capitalizes each

                      word in the string.

                      capitalize

                      ('QlikView

                      document')

                      Qlikview

                      Document

                      replace(string,

                      search string,

                      replace string)

                      Replaces the search

                      string in the string

                      with the replace

                      string.

                      replace('QlikView',

                      'Qlik', 'Click')

                      ClickView

                       

                      mid(string,

                      starting

                      character,

                      number of

                      characters

                      (optional))

                      Returns a substring

                      from the string,

                      starting at the

                      specified character.

                      Optionally, the

                      length of the

                      substring can be

                      specified. If no length

                      is specified, the

                      right-most part of the

                      string (starting at the

                      specified position) is

                      returned.

                      mid('QlikView', 5,

                      2)

                      mid('QlikView', 5)

                      Vi

                      View

                      index(string,

                      substring,

                      occurrence

                      (optional))

                      Returns the

                      position at which

                      the substring is

                      found in the string.

                      If an occurrence is

                      specified, QlikView

                      will look for that

                      specific occurrence,

                      otherwise the

                      first occurrence

                      is assumed. If a

                      negative number

                      is supplied for

                      occurrence, QlikView

                      starts searching from

                      the end of the string.

                      If no match is found,

                      the function returns

                      0.

                      index('QlikView',

                      'i')

                      index('QlikView',

                      'i', 2)

                      index('QlikView',

                      'i', -1)

                      3

                      6

                      6

                      upper(string) Converts the string

                      to upper case.

                      upper('QlikView') QLIKVIEW

                      lower(string) Converts the string

                      to lower case.

                      lower('QlikView') qlikview

                      capitalize

                      (string)

                      Capitalizes each

                      word in the string.

                      capitalize

                      ('QlikView

                      document')

                      Qlikview

                      Document

                      replace(string,

                      search string,

                      replace string)

                      Replaces the search

                      string in the string

                      with the replace

                      string.

                      replace('QlikView',

                      'Qlik', 'Click')

                      ClickView

                      • Re: string funtions
                        ISHFAQUE AHMED

                        Dear Lohitha,

                         

                        Check this thread for list of string functions,

                        String Functions

                         

                         

                        Kind regards,

                        Ishfaque Ahmed