Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Here I have a "DataPrepare.qvw" that will be binary load, and I want to tag all fields in this qvw with $hidden. I tried the scripts like below.
LET vC = Concat($Field, ',');
TAG Fields $(vC) With $hidden;
But the variable vC has no value. What else should I do?
Thanks!
It's better you do it in .qvw with "_ "or "%" or , and add the SET HidePrefix=',' ; or SET HidePrefix='_' ; and qualify in start of the table so all table will have the same prefix.
This is a good idea at the beginning, but my DataPrepare.qvw has been built. The situation is that I need to refer to this established DataPrepare.qvw to the new report. If “HidePrefix” or "HideSuffix" supports wildcards and matches all fields, it may be perfect. \('_')/
In this case you can load all tables into qvd from DataPrepare.qvw (using loop) and add one more layer .qvw and add prefix and use as binary load.
Step :
Create new ,qvw say DataPrepare1.qvw
1) Load Binary.
2) Store into .qvd (using loop)
3) Drop all table after store and reload using prefix.
FOR vCount = 0 to NoOfTables()-1
LET vTableName = TableName($(vCount));
STORE $(vTableName) INTO $(vTableName).qvd (qvd);
NEXT vCount
The description is very clear. Thank you very much! However, these field names have undergone substantial changes, and my front end expressions may need to be modified again.
My approach is to enumerate all the columns (though very many, but I can export them from document properties) and apply TAG instructions.
I needed the same and found this solution today.
Get all tables and fields: https://community.qlik.com/t5/App-Development/Export-List-of-Fields-from-Script/td-p/11791
//Iterate through the loaded tables
For t = 0 to NoOfTables() - 1
//Iterate through the fields of table
For f = 1 to NoOfFields(TableName($(t)))
Tables:
Load
TableName($(t)) as Table,
TableNumber(TableName($(t))) as TableNo,
NoOfRows(TableName($(t))) as TableRows,
FieldName($(f),TableName($(t))) as Field,
FieldNumber(FieldName($(f),TableName($(t))),TableName($(t))) as FieldNo
Autogenerate 1;
Next f
Next t;
//concat fields on new table
[FIELDS]:
LOAD Concat(Field,', ') AS ALLFIELDS Resident Tables;
//drop Tables
Drop Table Tables;
let vFields = Peek('ALLFIELDS',0,'FIELDS');
TAG $(vFields) WITH $hidden;
Is there a way to add all fields as hidden except a list of some fields?
From the above example:
...
LOAD Concat(Field,', ') AS ALLFIELDS Resident Tables where match(Field, 'x', 'y', 'z') = 0;
...