Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set document title from variable

Hi Everyone,

Is it possible to set the title of a Qlikview document to the value of a variable?

Looking under Settings>Document Properties>General>Title, there is an option to put in an expression, but the title turns to the variable name, not the actual variable value.

I am using version 12 SR1.

Thanks!

Michael

Labels (1)
1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

The Document Title expression button is one of those always-broken-features of QlikView. You can put anything in this field, but axpressions won't work.

Your second question is a bit contra-productive. QlikView has a very powerful server-based distribution system for its BI applications. All distribution/licensing/usage/management properties in QlikView server are tied to the filename of the QlikView document. You would get into a complete mess rather quickly if documents started changing their names.

OTOH, you can easily create some macro code that uses the "ActiveDocument.SaveAs" method to save a copy of the current document under a different name. Consult the APIGuide for an example.

Peter

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Sorry - need to rephrase my question.

I need to save my document with a variable value.

So, if I had a variable vName=doc_name, I'd like to automatically save the document as "doc_name.qvw".

Is that possible?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

The Document Title expression button is one of those always-broken-features of QlikView. You can put anything in this field, but axpressions won't work.

Your second question is a bit contra-productive. QlikView has a very powerful server-based distribution system for its BI applications. All distribution/licensing/usage/management properties in QlikView server are tied to the filename of the QlikView document. You would get into a complete mess rather quickly if documents started changing their names.

OTOH, you can easily create some macro code that uses the "ActiveDocument.SaveAs" method to save a copy of the current document under a different name. Consult the APIGuide for an example.

Peter

Anonymous
Not applicable
Author

Thanks Peter - using ActiveDocument.SaveAs did the trick.

Michael

jamesdmilne
Contributor II
Contributor II

Hi Michael,

You can set the document title using a macro, variable, and a trigger.

1) Add the following macro:

SUB SetDocumentTitle()

    set dp = ActiveDocument.GetProperties

    set v = ActiveDocument.Variables("vDocumentTitle")

    dp.WindowTitle = v.GetContent.String

    ActiveDocument.SetProperties dp

END SUB

2) Add a variable vDocumentTitle.  It can use any valid expression.  If you are using a string constant do not enclose it in parentheses.

3) Add a document event trigger with an external action "Run Macro" and run the macro SetDocumentTitle.  I suggest adding the trigger to either the OnOpen, OnPostReload, or OnPostReduceData events.

James