Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello dear community,
I have a table 'vTable'. With a number of x columns. I do not know the exact number and not the column names. Now I would like to calculate a hash value over all columns (per line).
I can calculate the number of columns with
Num(NoOfRows('$(vTable)'),'#.##0,#') as TableRows,
and name with
FOR i = 1 to NoOfFields('$(vTable)') Fields: LOAD FieldName($(i),'$(vTable)') AS FieldName AutoGenerate 1 ; NEXT i
how do I now get the function 'Autonumberhash256 ()' fed so that I get the desired hash value?
Thanks in advance and have a nice day 😄
You could probably create a variable to concatenate all the field names as a string and then use that in autonumberhash256(), like:
Let vFieldsConcatenated=; FOR i = 1 to NoOfFields('tTable') Fields: LOAD FieldName($(i),'tTable') AS FieldName AutoGenerate 1 ; Let vFieldsConcatenated='$(vFieldsConcatenated)'&If($(i)>1,',')&Peek('FieldName'); NEXT i RegionSales: LOAD *, AutoNumberHash256($(vFieldsConcatenated)) as HashMkey Resident tTable;
It's not quite clear for me what do you want to do. Do you want to apply the hash-logic for the columns within the table or for the records? What is the aim behind it?
- Marcus
I want to use the hash logic for every row within the table.
so that i can compare the row with her predecessor.
Example:
Row_1: A, B, C, Hash=100
Row_2: A, D, C, Hash=105 -> i get the information that in this row is a change.
You could probably create a variable to concatenate all the field names as a string and then use that in autonumberhash256(), like:
Let vFieldsConcatenated=; FOR i = 1 to NoOfFields('tTable') Fields: LOAD FieldName($(i),'tTable') AS FieldName AutoGenerate 1 ; Let vFieldsConcatenated='$(vFieldsConcatenated)'&If($(i)>1,',')&Peek('FieldName'); NEXT i RegionSales: LOAD *, AutoNumberHash256($(vFieldsConcatenated)) as HashMkey Resident tTable;
thanks, that is excactly what iam looking for.
VG