Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
cbushey1
Creator III
Creator III

Is it possible to retrieve a list of fields with a specific (custom) tag in the same script that tags them?

Hi there!

At the end of my data model script, I tag some fields with a specific value "$phi". 

I am hoping to transform that into a QVD as I want to use it in Section access. 

Does anyone know if it is possible to access a list of fields that have a specific tag during the same script run that assigns the tags? I know I can use the HTML load feature on the QVW but that wont work for an application that is already open. 

TAG FIELDS
field1,field2,field3 with '$PHI';
Labels (2)
1 Solution

Accepted Solutions
cbushey1
Creator III
Creator III
Author

Oh okay. Thanks for explaining, but that isnt what I am looking to do. 

I ended up just creating a QVD via an inline statement that I can reference in the section access script. Still requires a manual field update but so did my previous tag approach.

View solution in original post

4 Replies
marcus_sommer

AFAIK you couldn't query fields/tables if they have a (certain) tag or comment else these kind of information is just a popup info on various places.

But you could place these information within another table and merging them together with your mentioned qvd. An alternatively to this classical approach may be to include your extra-information within the field-name. This may require an appropriate re-naming before the qvd is finally stored and again by reading from there.

I'm not quite sure what do you want to achieve with this information - probably defining some OMIT statements for a horizontal access control - but it will always cost some extra efforts in regard to the classical vertical access control and I assume that the classical way with keeping all relevant information within n tables is in the end easier as such special ways. 

- Marcus

cbushey1
Creator III
Creator III
Author

Thanks @marcus_sommer . 

My goal is to identify fields to use for the section access OMIT somewhat systematically. Recognizing that the tag process is still manual. 

It looks like the simplest approach for this might be to create an inline with my desired fieldnames and export to QVD and skip the tagging process altogether.

However, I am curious what you meant by "include your extra-information within the field-name". Could you elaborate?

marcus_sommer

Meant was something like:

M: mapping load * inline [
F1, F2
FieldX, phiFieldX
FieldY, phiFieldY];

load ...

rename fields using M;

store ...

By loading from this qvd you could access this kind of information, for example with a loop over loaded fieldname(), then doing anything and in the end you may rename your field again.

Like hinted above such approaches are possible but mostly there are easier ways available.

- Marcus

cbushey1
Creator III
Creator III
Author

Oh okay. Thanks for explaining, but that isnt what I am looking to do. 

I ended up just creating a QVD via an inline statement that I can reference in the section access script. Still requires a manual field update but so did my previous tag approach.