5 Replies Latest reply: May 25, 2017 1:12 PM by Rob Wunderlich RSS

    User-defined functions equivalent in Qlik Sense

    William Christensen

      From time to time I find myself rewriting the same code over and over again. A simple example might be something like removing special characters that are not stripped by the default trim function.

       

      Replace(Replace(myFieldName, char(194), ''), char(160), '')

       

      Now suppose I want to make a custom trim that will accept a field name and perform a replace action. Ideally, I would like this new function to be usable in the load script and as well as in the application. How can this functionality be accomplished to prevent unnecessary code duplication.