5 Replies Latest reply: Mar 9, 2015 8:21 AM by Tom Cotterill RSS

    Parameterised variable as a string

    Peter Turner

      Hello!

       

      I'm trying to create a parameterised variable 'My_Function' and pass it a whole bunch of filters to be used in set analysis.

      The problem is that the filters have a comma ',' between them for use in set analysis, and the function treats this as a separator for multiple variables.

       

      Example parameterised variable 'My_Function':

      SUM( {<$1> } Quantity)

       

      I would call this function with:

      My_Function($(vDateFilter),$(vType))

      There would actually be 5+ filters and afew different combinations of them.

      Where vDateFilter=   Date = {"<=$(vMaxDate)"}

      and vType= [LinkType] = {01}

       

       

      What QlikView actually does is:

      SUM( {<Date = {"<=$(vMaxDate)"}> } Quantity) and this will evaluate ok and produce a value, but the other filters such as vType do not get passed over.

       

      I'd like QlikView todo this

      SUM( {<Date = {"<=$(vMaxDate)"}, [LinkType] = {01} > } Quantity)

       

      I have tried adding the comma into a variable called vComma and passing $(vDateFilter)$(vComma)$(vType)

      Also tried various combinations of dollar expansion and quotes etc, but just not getting what I'm looking for.

       

      Any suggestions?