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: 
fabb95501
Partner - Contributor III
Partner - Contributor III

Set variable based on Webview/AJAX mode

Hello,

is it possible to set a variable in the following way?

=if(visualization=Webview/AJAX,1,0)

My goal is to set the variable equal to 1 if the Webview/AJAX button is selected, else set the variable equal to 0.

Best regards,

Fabio

2 Solutions

Accepted Solutions
m_woolf
Master II
Master II

if(len(clientplatform())>0,1,0)

View solution in original post

MVW
Contributor III
Contributor III

clientplatform() is empty when using the desktop client in webview mode. It will not be empty if you use AJAX in browser.

Are you trying to set this variable automatically or are you setting this with an action attached to a button? If you are using an action, then you can have a macro that assigns a value to some variable to indicate it's not ajax/webview mode. Macros don't run in ajax/webview.

View solution in original post

4 Replies
m_woolf
Master II
Master II

if(len(clientplatform())>0,1,0)

fabb95501
Partner - Contributor III
Partner - Contributor III
Author

Hi,

thanks for your answer.

In my Qlikview12 document, the function clientplatform() is always empty, that's why the expression gives me the value 0 as well as when I select the AJAX button.

Do you know why?

Fabio

MVW
Contributor III
Contributor III

clientplatform() is empty when using the desktop client in webview mode. It will not be empty if you use AJAX in browser.

Are you trying to set this variable automatically or are you setting this with an action attached to a button? If you are using an action, then you can have a macro that assigns a value to some variable to indicate it's not ajax/webview mode. Macros don't run in ajax/webview.

fabb95501
Partner - Contributor III
Partner - Contributor III
Author

Hi, thanks for your answer.

I'm going to set this variable automatically.

Regards,

Fabio