Qlik Community

QlikView Documents

Documents for QlikView related information.

Subfunction HideFields to create System Fields

arbernardez
New Contributor III

Subfunction HideFields to create System Fields

This is a sub function that will add the tag hidden to each field within a table. after that, these fields will be visible only when "show system fields" is checked on.


It's useful when there are fields that are not needed to be selectable by data model final users

SUB HideFields (vDLX.Table)

/**

* @Description Subfunction HideFields will add the tag hidden to each field within a table.

* after that this fields only will be visible when "show system fields" is checked on.

* @author  Alberto Rodríguez Bernárdez

* @DateYMD 20170104

* @Version 1.0

**/

/**

* @parameter 1 vDLX.Table: Table name which fields will be hidden as system fields

*/

  Trace hiding fields of table $(vDLX.Table);

  for vDLX.Temp=1 to NoOfFields('$(vDLX.Table)')

  Let vDLX.FieldName = FieldName($(vDLX.Temp),'$(vDLX.Table)');

  TAG Field [$(vDLX.FieldName)] with '$hidden';

  comment field [$(vDLX.FieldName)] with 'Its a hidden field';

  NEXT

/**  Example of use **/

/**  Call to subfunction HideFields('<Table>');

  CALL HideFields('LOG') ;

*/

ENDSUB //End Subfunction HideFields

Thanks for your feedback and comments.

Best regards,


Alberto Rodríguez


Labels (2)
Attachments
Comments
ahaahaaha
Honored Contributor

Thank you for the interesting information.

Version history
Revision #:
1 of 1
Last update:
‎01-04-2017 12:41 PM
Updated by: