Hi guys,
I am reviewing the data fields in my Qlik environment in order to check for personal data and GDPR compliance.
Thanks in advance
Darrell
The answer to the first question is $Field, it is a list of fields in the loaded tables. See the system fields information here: https://help.qlik.com/en-US/sense/September2017/Subsystems/Hub/Content/Scripting/system-fields.htm
Thanks Jerry...
1)
If You want to know how to do this in the script to directly export it by "store...into':
In the end of your script do as follow:
for i=0 to NoOfTables()-1
let vTableName$(i)= TableName($(i));
let nOffield=NoOfFields('$(vTableName$(i))');
for j=1 to $(nOffield)
LET Field$(j) = FieldName(j,'$(vTableName$(i))');
final:
load Distinct '$(vTableName$(i))' as TableName, '$(Field$(j))' as Field Resident $(vTableName$(i));
next j
next i
store final into appName.qvd;
Result:
This final table will contain the name of all the tables and the corresponding fields.
You can export this table and have all what you want.
Another dirrect way, is to use system functions that qlik proposes.
Create a simple table with 2 dimension
$Table
$Field
and you'll have what u want; you can then export the table:
2)
To have all he fields of all the app:
I don't think there is a direct way:
but a way to it, is create the above script in all of ur apps; store all of the created final tables in all of the apps in the same folder.
Create a new app:
with only this script:
AllTable
load * from *.qvd;
Now:
store this table that's ll contain all of the tables and fields of all the qlik sense app directly in the script
or create a simple table and export it.
Hope that was clear?
what about binary load?
Hi Omar,
Thanks for this. I have added to script but it looks like it does not work where the field name has a gap between the name e.g. [Survey Responses].
The following error occurred:
Unexpected token: 'Responses', expected one of: 'Where', 'While', 'Group', 'Order'
The error occurred here:
final: load Distinct 'Survey Responses' as TableName, 'ResponseKey' as Field Resident Survey >>>>>>Responses<<<<<<
Thanks in advance..
Hi Omar,
Version that allows spaces in field names..
LET vDocName = DocumentTitle();
for i = 0 to NoOfTables()-1
let vTableName$(i) = TableName($(i));
let nOffield = NoOfFields('$(vTableName$(i))');
for j = 1 to '$(nOffield)'
LET Field$(j) = FieldName(j,'$(vTableName$(i))');
final:
load
Distinct
'$(vTableName$(i))' as TableName,
'$(Field$(j))' as Field
Resident '$(vTableName$(i))';
next j
next i
store final into [lib://GDPR_DATA_LIST/$(vDocName).QVD] (qvd);
Thanks Again..