Is it possible to have a trigger in QlikView that will 'Open QlikView Document' and pass that document a value for a variable?
For instance, say I have a document called doc1.qvw
I also have a variable called var1 in doc1.qvw
When they click a button on another document, I would like to 'Open QlikView Document' doc1.qvw and set the value of var1 = 1. I tried:
doc1.qvw&var1=1
and this doesn't seem to work, I'm thinking since it is the 'Open QlikView Document' action, it isn't recognizing the passing of parameters for the variable value
You need to mark "Transfer State"
I tried this, and it didn't copy the variable value over. Is that what you were thinking it would do?
Hi,
This is not supported you can vote for the Idea here.
http://community.qlik.com/ideas/2359
if you can you use the QVP protocol instead then use below
qvp://YourServer/Doc.qvw?&myvar=1
Regards
ASHFAQ
If possible u can create an inline field with all the possible values of variable and select it in the first document which will be passed to the second document through document chaining if u create the same inline field in second document.
-Sundar
I think this is the right track. Based on passing that through a field named MyState (for instance, 1), I'd like a different sheet to be opened. I tried both on change on the inline field, and on open of the second qvw, and it isn't working correctly. It will only change the sheet to the first sheet in the field even if MyState = 2.
=If(Only(MyState) = 1, 'SH01', 'SH02')
I'm attaching an example:
doc1.qvw has inline load of MyState (1 or 2). It also has a button ('OPEN DOC') that opens a QlikView document doc2.qvw and transfers state
doc2 has two sheets (SH01 and SH02). It also has the same inline load of doc1.qvw. There are actions on open of the document and on select of MyState:
=if(Only(MyState) = 1, 'SH01', 'SH02')
If I change the values around on doc, and open the new doc, it doesn't take me to the new sheet but does carry over the selection. From doc2, if I make different selections, it changes the sheet. Any ideas? Thank you for everyones help!
Ooops, attachments:
Also you can create a macro:
sub OpenDoc
set App = ActiveDocument.GetApplication
set newdoc = App.OpenDoc(".\test2.qvw")
Set v = ActiveDocument.Variables("Var")
Set v2 = newDoc.Variables("Var")
v2.SetContent v.GetContent.String, true
end sub
Hi joshabbott,
You can achieve this in below way, but make sure you do the data validation after document is chained.
As QlikView server uses bookmark when chaining document, it will pass the variables values to the new opened application, like for the selections.
Let us know if this helps!