Discussion board where members can get started with QlikView.
I am trying to apply hash128() function on loaded records but I don't really know the name of the loaded fields neither their number .
Besides , the number of the fields is variable .
I tried hash128(*) but it doesn't work. Is there any possible way to solve this problem?
You can use system functions to query the name and number of fields in a table.
Iterate over the field names and create variable with a concatenated string of your field names, then expand the variable in your hash128() function as argument.
System functions (from the help).
NoOfFields([ 'TableName ' ])
Returns the number of fields in a previously loaded table.
LET a = NoOfFields('tab1');
Load *, NoOfFields( ) from abc.csv;
Returns the name of the field with the specified number within a previously loaded table.
If the function is used within a load statement, it must not reference the table currently being loaded.
LET a = FieldName(4,'tab1');
T1:Load a, b, c, d from abc.csvT2: Load FieldName (2, 'T1') Autogenerate 1;
View solution in original post
I think we need to know a bit more about what you're trying to do here.
Hash128 is usually used to create a composite key of a number of known fields because it is smaller and faster than a concatenate of the fields
Example using QVD file here: Re: How to apply a hash function to all fields
That's almost a circular reference in discussions