Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

Pass variable value from one QVW to another

How can I pass variable values from one QVW to another QVW? 

If my Variable1 value in QVW1 is 1, then when I open QVW2 using Action, Variable1 in QVW2 has to be assigned value '2'. I applied 'Transfer State' in action but doesn't help.

I went through other related posts but most of them involve Macros etc.

Is there a simple way to achieve this?

Labels (1)
2 Replies
Saravanan_Desingh

AFAIK, variables can not be passed between QV's. 

But, how I do:

Create a table with key-value pairs:

QMvars:
LOAD * INLINE [
    QMkey, QMval
    vFri, 4/3/2020

    vSat, 4/4/2020
    vSun, 4/5/2020
    vTue, 3/31/2020
];

After receiving it through BINARY LOAD,

QMstr:
LOAD Concat('Let '&QMkey&'='&Chr(39)&QMval&Chr(39),';') As QMstr
Resident QMvars;

Let vQMstr = Peek('QMstr',0,'QMstr');

$(vQMstr); //Execute the string


Drop Table QMstr;

Brett_Bleess
Former Employee
Former Employee

Check the Help link below, scroll to the Open QlikView Document header and check the contents there against what you are seeing, if something is not behaving according to the documentation, I would recommend submitting a support case at that point.

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Button2.htm#anc...

The way the Help reads, the transfer state option is going to xfer the existing values, so it would set the variable to 1, not 2 in the other doc if I am reading things correctly.  You may want to consider using the Open URL if you are using Ajax client, as that way you could use the OpenDoc call and then you have access to the parameters to set things that way, but I am not sure you can push in a variable setting.  Sorry I do not have anything better for you.

Regards,
Brett

 

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.