TabPy Tableau Convert Dimension where each row is in Hex to ASCII with calculated field with Python

97 Views Asked by At

I have a Dimension in Tableau where each row is in Hex (Tableau Datatype is string, but these values are actually hex). I want to convert this dimension (each row) into ASCII with Python Code (TabPy (calculated Field)). Does anyone know how to do that? :D

Thank you in advance!

1

There are 1 best solutions below

1
On

I found a solution:

SCRIPT_STR("
result=[]
for a in (_arg1):
   if a == None:
      result.append('')
   else:
      result.append(bytes.fromhex(a).decode('utf-8'))
return result

",ATTR([Your Dimension]))