Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
Jennell_McIntire
Employee
Employee

Did you know that you can hide fields in your data model from appearing in a field list?  Similar to how we have the ability to show and hide system fields, we can also show and hide fields that we create in the script.  When the Show System Fields checkbox is checked, system fields and all fields created in the script are listed.  When the Show System Fields is not checked, the system fields and any fields hidden using HidePrefix or HideSuffix will not be displayed in the list.

system fields.png

It is very easy to do.  In the script, you set the user defined variable HidePrefix to the text that will prefix fields that you would like to hide.  In the Call Detail Record Analysis demo, I created a sheet that acted as a report giving the user the ability to select the dimensions and measures they wanted to see in the table.

report.png

To create the list of dimensions and measures that I wanted to make available to the user, I created two new fields: _dimension and _metrics.  You can find details on how to create a customizable report in this blog.  These fields are used solely on the report sheet to display the dimensions and measures so I decided to hide them so that they did not clutter up my field list.  To do this, I set the HidePrefix variable in my script.

SET HidePrefix = '_';

This means that any field that starts with the underscore (_) character will be hidden from the field list.  I then created my new fields with the underscore prefix.

Dimensions:
LOAD * INLINE [_dimension
Call Date
Calling Number
Called Number
Cell Towers Visited
IMSI
Direction
First Cell Tower
Last Cell Tower
Manufacturer
Phone Type
Reason for Drop
Week
]
;

Metrics:
LOAD * INLINE [_metricsNo, _metrics
1, Calls
2, Distinct Cell Towers
3, Dropped Call
4, Handovers
5, Setup Time
6, Talk Time
]
;

So now when I view the field list with the Show System Field checkbox unchecked, I cannot see the fields I created using the underscore character in the Available Fields list.

field list2.png

This keeps the available fields list shorter and removes fields that I know the user will not need to use anywhere else in the application.  Users also have the ability to use HideSuffix as well which does the same thing as HidePrefix except this looks at the ending of the field name for the text that is set in the HideSuffix variable.  HidePrefix is an easy way to keep the field list in your application clean and hides fields that you may not want the user to use or that you may want to hide to eliminate confusion.

Thanks,

Jennell

25 Comments
mr_barriesmith
Partner - Creator
Partner - Creator

I also like TAG FIELDS ... WITH $hidden;

Then I don't have to use a prefix - now wouldn't it be great if Qlik Sense picked up this metadata.

6,694 Views
Marcio_Campestrini
Specialist
Specialist

Hi Jennel.

Thanks for the post.

0 Likes
6,694 Views
datanibbler
Champion
Champion

Really cool.

We were using this at a time to direct a macro that would, when an app was opened via doc_chaining from a management_dashboard using a specific button, open a specific sheet.

We came away from that in the meantime, but we might use it again as we might start rolling out the Client_software as a means of opening QlikView to all machines - that would get us rid of display_problems rgd. the browser_view.

Thanks for the great post!

0 Likes
6,694 Views
marwen_garwachi
Creator II
Creator II

Good to know Thanks a lot !

0 Likes
6,694 Views
Anonymous
Not applicable

It also hides the field from the Current Selections object which I have found really useful.

6,694 Views
Not applicable

This is very good post. We are using the HidePrefix all the autonumber generated keys

0 Likes
6,694 Views
jcarpenter9
Partner - Creator
Partner - Creator

I am revising a QlikView app that uses sheet triggers to make selections in several hidden fields. It is making troubleshooting difficult, because I cannot readily see what selections are in effect for all fields.

Other than turning off HidePrefix temporarily on reload, can you suggest other ways for developers to see selections in hidden fields?

0 Likes
5,407 Views
Anonymous
Not applicable

You could create a Text Box with expression

     =GetFieldSelections ( [YourField]  , ',' )

0 Likes
5,407 Views
jcarpenter9
Partner - Creator
Partner - Creator

Thanks, Bill, good suggestion. I may just need to turn off HidePrefix temporarily; part of the problem is not knowing all of the fields that could have selections. Then once they're all identified and we create some text objects as you describe, turn on HidePrefix again and reload. This is just for developers, not for end users.

5,407 Views
IAMDV
Luminary Alumni
Luminary Alumni

Thanks. We also have hide suffix.

0 Likes
5,407 Views