<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Ad-Hoc Variable Field Names and Values in Dimensions/Expressions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443082#M486176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;There are two issues to solve here, loading the data and displaying the data. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For loading the data, you can load the definitions table then loop through each individual row in the defination table to load the values from the CustomerValues table for each type. By looping, you can load the data from the correct column. You can name the data column UDF&amp;lt;UDFID&amp;gt; (e.g., UDF11 for Fruits in Customer A). If the id values can be large, you will have to create a new field with the loop value to associate the id to the loop value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To display the data, you will create a table with as many expressions as the customer with the most UDF fields. Each UDF expression UDF&amp;lt;id&amp;gt; and the label will be =Only(UDFID=&amp;lt;id&amp;gt; Name) (or use loop value instead of id). If you have many values (more than you want to create manaually) you will need to create a macro to dynamically add the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Van&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Mar 2013 18:33:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-03-15T18:33:23Z</dc:date>
    <item>
      <title>Ad-Hoc Variable Field Names and Values in Dimensions/Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443081#M486175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Recently I got a assignment from the owner of my company to make our standard reports include what we call UDFs (User-Defined Fields) so that each client (which resides in a different db) can have any or all of their UDFs included in a existing report without it being different from client to client or db to db.&amp;nbsp; Also each client has a variable number of UDFs as they are unlimited.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The tables involved are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CustomerValues-&lt;/P&gt;&lt;P&gt;UDFID, CustomerID, UDFValue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Definitions-&lt;/P&gt;&lt;P&gt;UDFID, Name, FieldType&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples:&lt;/P&gt;&lt;P&gt;Client A (db A)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CustomerValues-&lt;/P&gt;&lt;P&gt;UDFID, CustomerID, UDFValue&lt;/P&gt;&lt;P&gt;11 , 123456 , Apples&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Definitions-&lt;/P&gt;&lt;P&gt;UDFID, Name, FieldType&lt;/P&gt;&lt;P&gt;11 , Fruits , STR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Client B (db B)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CustomerValues-&lt;/P&gt;&lt;P&gt;UDFID, CustomerID, UDFValue&lt;/P&gt;&lt;P&gt;11 , 333444 , 112233&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Definitions-&lt;/P&gt;&lt;P&gt;UDFID, Name, FieldType&lt;/P&gt;&lt;P&gt;11 , Account , INT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have researched many ways to try to accomplish making both datasets show up on a report.&amp;nbsp; All of which require some hard-coded values; which&lt;/P&gt;&lt;P&gt;then renders the unversality null and void.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The last approach I tried was to have the fields put into a view where the outcome was:&lt;/P&gt;&lt;P&gt;CustomerID,UDF1,UDF1Name,UDF2,UDF2Name,UDF3,UDF3Name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I ran into the lack of ability to dynamically name the dimensions/expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other requirement is that this report run as fast as possible, given that one clients UDF combinations result in a record set of over 6 million rows.&amp;nbsp; They have 57 different UDFs and 300,000 clients; so the product of all 57 UDFs per each customer is a staggeringly large number of returns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My DBA has said that we must find an answer to this problem, and is open to changing how we structure the UDF tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate any ideas that lead to being able to have the same report (with zero differences) apply to two DBs using the UDFs from each client in the same way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My boss has also authorized me to seek out any QV Consultants for hire who may be able to resolve this problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2013 16:13:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443081#M486175</guid>
      <dc:creator />
      <dc:date>2013-03-14T16:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Ad-Hoc Variable Field Names and Values in Dimensions/Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443082#M486176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;There are two issues to solve here, loading the data and displaying the data. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For loading the data, you can load the definitions table then loop through each individual row in the defination table to load the values from the CustomerValues table for each type. By looping, you can load the data from the correct column. You can name the data column UDF&amp;lt;UDFID&amp;gt; (e.g., UDF11 for Fruits in Customer A). If the id values can be large, you will have to create a new field with the loop value to associate the id to the loop value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To display the data, you will create a table with as many expressions as the customer with the most UDF fields. Each UDF expression UDF&amp;lt;id&amp;gt; and the label will be =Only(UDFID=&amp;lt;id&amp;gt; Name) (or use loop value instead of id). If you have many values (more than you want to create manaually) you will need to create a macro to dynamically add the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Van&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 18:33:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443082#M486176</guid>
      <dc:creator />
      <dc:date>2013-03-15T18:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Ad-Hoc Variable Field Names and Values in Dimensions/Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443083#M486177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply vhuynh.&amp;nbsp; I have not been back to check on answers since I have been nose-down trying to solve this issue.&amp;nbsp; I have come up with a similar answer, but without the macro to dynamically create the expressions, as I am not exactly sure what you mean.&amp;nbsp; I thought I would share what I have done so far and see if anyone has a more elegant or more efficient solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I create a table (see below) with a column for each customers UDFname and UDFValue for each UDF on a client.&lt;/P&gt;&lt;P&gt;I then select those into a table to load into the QVW and use for the Dimensions/Expressions the UDF&lt;X&gt;Value while the name is the UDF&lt;X&gt;Name.&amp;nbsp; Then to show/hide each UDF I take the total possible values into another table and use the following for the Presentation of each UDF field [&amp;nbsp; =SubStringCount(GetFieldSelections(UDFName,',',Count(Distinct UDFName)),UDF20Name)&amp;nbsp;&amp;nbsp; ].&amp;nbsp; That way whenever a field is selected to been shown from the ListBox the column in the table will be shown/hidden based on the name the client recognizes rather than the UDF&lt;X&gt;Name label.&lt;/X&gt;&lt;/X&gt;&lt;/X&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My only problem now is saving the selections from one load to another when we use QV server to QV Publisher to a display in our page.&amp;nbsp; The clients are not seeing the QVW, rather a translated copy, so we loose the bookmarks whenever the report is re-loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is from the Load Statement in the report::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;DECLARE @colsName NVARCHAR(2000)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT&amp;nbsp; @colsName = COALESCE(@colsName + ',[UDF' + CAST(UDFDefIds AS VARCHAR(10)) + 'Value] varchar(50)'+ ',[UDF' + CAST(UDFDefIds AS VARCHAR(10)) + 'Name] varchar(50)',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '[UDF' + CAST(UDFDefIds AS VARCHAR(10)) + 'Value] varchar(50)'+ ',[UDF' + CAST(UDFDefIds AS VARCHAR(10)) + 'Name] varchar(50)')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&amp;nbsp;&amp;nbsp;&amp;nbsp; dbo.UDFDefs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORDER BY UDFDefIds&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DECLARE @zsql NVARCHAR(4000)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET @zsql = '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CREATE TABLE ##UDFMaster (CustID INT, ' + @colsName + '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXECUTE(@zsql)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; INSERT INTO ##UDFMaster (CustID)&lt;/P&gt;&lt;P&gt; SELECT DISTINCT CustID&lt;/P&gt;&lt;P&gt; FROM UDFCustVal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- POPULATE UDFValues&lt;/P&gt;&lt;P&gt;DECLARE @c CURSOR&lt;/P&gt;&lt;P&gt;DECLARE @UDFid INT&lt;/P&gt;&lt;P&gt;DECLARE @UDFMasterField NVARCHAR(1000)&lt;/P&gt;&lt;P&gt;DECLARE @sql NVARCHAR(1000)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET @c = CURSOR FOR&lt;/P&gt;&lt;P&gt;SELECT UDFDefIds&lt;/P&gt;&lt;P&gt;FROM dbo.UDFDefs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN @c&lt;/P&gt;&lt;P&gt;FETCH NEXT&lt;/P&gt;&lt;P&gt;FROM @c INTO @UDFid&lt;/P&gt;&lt;P&gt;WHILE @@FETCH_STATUS = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BEGIN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET @UDFMasterField = CAST('##UDFMaster'+'.'+'UDF'+CAST(@UDFid AS NVARCHAR(1000))+'Value' AS NVARCHAR(1000))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET @sql = '&lt;/P&gt;&lt;P&gt;UPDATE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ##UDFMaster&lt;/P&gt;&lt;P&gt;SET&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '+@UDFMasterField+' = UDFCustVal.UDFValue&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ##UDFMaster &lt;/P&gt;&lt;P&gt;INNER JOIN &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbo.UDFCustVal &lt;/P&gt;&lt;P&gt;ON ##UDFMaster.CustID = UDFCustVal.CustID&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;UDFCustVal.UDFDefIds = '+CAST(@UDFId AS NVARCHAR(1000))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--PRINT @##UDFMasterField &lt;/P&gt;&lt;P&gt;--PRINT @sql&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC sp_executesql @sql&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FETCH NEXT FROM @c INTO @UDFid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE @c&lt;/P&gt;&lt;P&gt;DEALLOCATE @c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; -- POPULATE UDFNames&lt;/P&gt;&lt;P&gt;DECLARE @c2 CURSOR&lt;/P&gt;&lt;P&gt;DECLARE @UDFId2 INT&lt;/P&gt;&lt;P&gt;DECLARE @UDFMasterField2 NVARCHAR(1000)&lt;/P&gt;&lt;P&gt;DECLARE @sql2 NVARCHAR(1000)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET @c2 = CURSOR FOR&lt;/P&gt;&lt;P&gt;SELECT UDFDefIds&lt;/P&gt;&lt;P&gt;FROM dbo.UDFDefs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN @c2&lt;/P&gt;&lt;P&gt;FETCH NEXT&lt;/P&gt;&lt;P&gt;FROM @c2 INTO @UDFid2&lt;/P&gt;&lt;P&gt;WHILE @@FETCH_STATUS = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BEGIN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET @UDFMasterField2 = CAST('##UDFMaster'+'.'+'UDF'+CAST(@UDFid2 AS NVARCHAR(1000))+'Name' AS NVARCHAR(1000))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET @sql2 = '&lt;/P&gt;&lt;P&gt;UPDATE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ##UDFMaster&lt;/P&gt;&lt;P&gt;SET&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '+@UDFMasterField2+' = UDFDefs.UDFName&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UDFDefs &lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;UDFDefs.UDFDefIds = '+CAST(@UDFId2 AS NVARCHAR(1000))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--PRINT @##UDFMasterField &lt;/P&gt;&lt;P&gt;--PRINT @sql2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC sp_executesql @sql2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FETCH NEXT FROM @c2 INTO @UDFid2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE @c2&lt;/P&gt;&lt;P&gt;DEALLOCATE @c2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM ##UDFMaster ORDER BY CustID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEWUDFs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;CustID,&lt;/P&gt;&lt;P&gt;UDF1Value , UDF1Name ,&lt;/P&gt;&lt;P&gt;UDF2Value , UDF2Name ,&lt;/P&gt;&lt;P&gt;UDF3Value , UDF3Name ,&lt;/P&gt;&lt;P&gt;UDF4Value , UDF4Name ,&lt;/P&gt;&lt;P&gt;UDF5Value , UDF5Name ,&lt;/P&gt;&lt;P&gt;UDF6Value , UDF6Name ,&lt;/P&gt;&lt;P&gt;UDF7Value , UDF7Name ,&lt;/P&gt;&lt;P&gt;UDF8Value , UDF8Name ,&lt;/P&gt;&lt;P&gt;UDF9Value , UDF9Name ,&lt;/P&gt;&lt;P&gt;UDF10Value , UDF10Name ,&lt;/P&gt;&lt;P&gt;UDF11Value , UDF11Name ,&lt;/P&gt;&lt;P&gt;UDF12Value , UDF12Name ,&lt;/P&gt;&lt;P&gt;UDF13Value , UDF13Name ,&lt;/P&gt;&lt;P&gt;UDF14Value , UDF14Name ,&lt;/P&gt;&lt;P&gt;UDF15Value , UDF15Name ,&lt;/P&gt;&lt;P&gt;UDF16Value , UDF16Name ,&lt;/P&gt;&lt;P&gt;UDF17Value , UDF17Name ,&lt;/P&gt;&lt;P&gt;UDF18Value , UDF18Name ,&lt;/P&gt;&lt;P&gt;UDF19Value , UDF19Name ,&lt;/P&gt;&lt;P&gt;UDF20Value , UDF20Name ,&lt;/P&gt;&lt;P&gt;UDF21Value , UDF21Name ,&lt;/P&gt;&lt;P&gt;UDF22Value , UDF22Name ,&lt;/P&gt;&lt;P&gt;UDF23Value , UDF23Name ,&lt;/P&gt;&lt;P&gt;UDF24Value , UDF24Name ,&lt;/P&gt;&lt;P&gt;UDF25Value , UDF25Name ,&lt;/P&gt;&lt;P&gt;UDF26Value , UDF26Name ,&lt;/P&gt;&lt;P&gt;UDF27Value , UDF27Name ,&lt;/P&gt;&lt;P&gt;UDF28Value , UDF28Name &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;SELECT CustID,&lt;/P&gt;&lt;P&gt;UDF1Value , UDF1Name ,UDF2Value , UDF2Name ,&lt;/P&gt;&lt;P&gt;UDF3Value , UDF3Name ,UDF4Value , UDF4Name ,&lt;/P&gt;&lt;P&gt;UDF5Value , UDF5Name ,UDF6Value , UDF6Name ,&lt;/P&gt;&lt;P&gt;UDF7Value , UDF7Name ,UDF8Value , UDF8Name ,&lt;/P&gt;&lt;P&gt;UDF9Value , UDF9Name ,UDF10Value , UDF10Name ,&lt;/P&gt;&lt;P&gt;UDF11Value , UDF11Name ,UDF12Value , UDF12Name ,&lt;/P&gt;&lt;P&gt;UDF13Value , UDF13Name ,UDF14Value , UDF14Name ,&lt;/P&gt;&lt;P&gt;UDF15Value , UDF15Name ,UDF16Value , UDF16Name ,&lt;/P&gt;&lt;P&gt;UDF17Value , UDF17Name ,UDF18Value , UDF18Name ,&lt;/P&gt;&lt;P&gt;UDF19Value , UDF19Name ,UDF20Value , UDF20Name ,&lt;/P&gt;&lt;P&gt;UDF21Value , UDF21Name ,UDF22Value , UDF22Name ,&lt;/P&gt;&lt;P&gt;UDF23Value , UDF23Name ,UDF24Value , UDF24Name ,&lt;/P&gt;&lt;P&gt;UDF25Value , UDF25Name ,UDF26Value , UDF26Name ,&lt;/P&gt;&lt;P&gt;UDF27Value , UDF27Name ,UDF28Value , UDF28Name&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM ##UDFMaster&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL DROP TABLE ##UDFMaster&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT UDFDefIds,UDFName FROM UDFDefs&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 21:57:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443083#M486177</guid>
      <dc:creator />
      <dc:date>2013-03-18T21:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Ad-Hoc Variable Field Names and Values in Dimensions/Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443084#M486178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Will you be loading multiple customers, each with different udf fields, into the same qvw file? If not then you don't really need the UDFName fields since the values will be the same. Each copy of the qvw file will need a to load the the definition table specific to the customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to load multiple customers into one qvw, then you will need to load the definition table with the customer ids.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One question I forgot to ask, since the qvw will be used for different customers (whether its one copy or multiple copies) the only thing you can do with the UDF fields is to report on them since there's no way to know what calculations make sense for a particular UDF field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached an example qvw that may help. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 16:58:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443084#M486178</guid>
      <dc:creator />
      <dc:date>2013-03-19T16:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Ad-Hoc Variable Field Names and Values in Dimensions/Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443085#M486179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you vhuynh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We will have multiple clients, who have multiple customers.&amp;nbsp; So, each client has a unique database with many customers; however each client's udf setup is unique to them.&amp;nbsp; The project is to have one report (copied verbatim to each client) that can be used on any db with any client and any combination of UDFs.&amp;nbsp; The main problems come from not being able to pre-load like with Crystal or any other type of straight loading software.&amp;nbsp; Because QV requires all the data at load time, I had to come up with a way to not have to explicitly name the fields.&amp;nbsp; The solution above is only workable if every client only has a set amount of UDFs, so that the load statement is not broken by looking for UDFxName column when no UDFxName column exists.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 19:21:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443085#M486179</guid>
      <dc:creator />
      <dc:date>2013-03-19T19:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Ad-Hoc Variable Field Names and Values in Dimensions/Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443086#M486180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can add conditional statements to only show the column if field has been loaded. Also, the set analysis in the example before can affect performance if there are many UDF fields so you can use variables instead and set the variable values during the script load. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 19:32:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443086#M486180</guid>
      <dc:creator />
      <dc:date>2013-03-19T19:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Ad-Hoc Variable Field Names and Values in Dimensions/Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443087#M486181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much vhuynh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both of your examples did work by themselves.&amp;nbsp; I can't say I completely understand what your are doing, but it is a faster loading solution and is better than what I came up with.&amp;nbsp; I really appreciate your work and effort on this one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 20:39:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443087#M486181</guid>
      <dc:creator />
      <dc:date>2013-03-19T20:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Ad-Hoc Variable Field Names and Values in Dimensions/Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443088#M486182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something that does happen is when we have larger clients with larger customer sets (327,000) with larger UDF ranges (57) any of the reports when just 1 udf is included; the allocated memory fails.&amp;nbsp; Any tips on reducing the memory impact?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 21:53:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443088#M486182</guid>
      <dc:creator />
      <dc:date>2013-03-19T21:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Ad-Hoc Variable Field Names and Values in Dimensions/Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443089#M486183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems that the join in the script load is not necessary and will create performance issues if there are many udf fields. Also, duplicate rows are created if there are multiple udf values for a particular udfid and customer. You can replace the if statement containing the join with the following. This should perform much better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UDFValues$(vUDFieldId):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NoConcatenate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load CustomerID, UDFValue as UDFField$(vUDFieldId) resident SQLValues where UDFID = $(vUDFID);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 23:08:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443089#M486183</guid>
      <dc:creator />
      <dc:date>2013-03-19T23:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Ad-Hoc Variable Field Names and Values in Dimensions/Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443090#M486184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;vhuynh, could not do it without you.&amp;nbsp; The script worked fine.&amp;nbsp; The report is performing much better.&amp;nbsp; It still has some slowness and tendency to have a memory problem; but that it because the UDFs are 6.5 million rows (when loaded only once).&amp;nbsp; However, I think at this point I can tell the requestor the slowness is in the amount of data, not the report's abilities.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 18:54:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ad-Hoc-Variable-Field-Names-and-Values-in-Dimensions-Expressions/m-p/443090#M486184</guid>
      <dc:creator />
      <dc:date>2013-03-20T18:54:42Z</dc:date>
    </item>
  </channel>
</rss>

