Qlik Community

QlikView Management

Discussion Board for collaboration on QlikView Management.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Champion
Champion

Automatically insert a variable whenever a new script_tab is opened?

Hi,

we have a "Template_QlikView" that should be used whenever a new app is to be created that has a number of standard_elements that should be used everywhere.

Whenever something new comes along and I think of some best way of doing it, I try to implement it there.

=> The newest thing I have is a variable that inserts a few lines to make the beginning of a new tab (in the script) more apparent when
      used in the Debugger or in the log. (it has to be inserted at the very end of a tab, though, to appear BEFORE the automatically
      inserted tab_name)

=> Is there any way I can set the editor to insert that variable_call at the very end of any new script_tab that I add automatically, like
     a template in MS_Office?

Thanks a lot!

Best regards,

DataNibbler

Tags (1)
1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Automatically insert a variable whenever a new script_tab is opened?

Hi DataNibbler,

I don't think that there is a possibility to do that automated. But you could create a complete script-tab template as external script and insert this in a additionally step (2 clicks) - script-file could look like this:

/*---------------------------[ Tab X ]--------------------------------------------------------------

Goal: ....

Description: .....

------------------------------------------------------------------------------------------------------*/

// place your statements here ...

/*---------------------------[ End ]--------------------------------------------------------------*/

IncludeYourTabHighlithingVariable;

- Marcus

View solution in original post

8 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Automatically insert a variable whenever a new script_tab is opened?

Hi DataNibbler,

I don't think that there is a possibility to do that automated. But you could create a complete script-tab template as external script and insert this in a additionally step (2 clicks) - script-file could look like this:

/*---------------------------[ Tab X ]--------------------------------------------------------------

Goal: ....

Description: .....

------------------------------------------------------------------------------------------------------*/

// place your statements here ...

/*---------------------------[ End ]--------------------------------------------------------------*/

IncludeYourTabHighlithingVariable;

- Marcus

View solution in original post

Highlighted
Champion
Champion

Re: Automatically insert a variable whenever a new script_tab is opened?

Hi Marcus,

that would be an idea. I had been thinking about sth like this a while ago. Let's see.

Best regards,

DataNibbler

Highlighted
Champion
Champion

Re: Automatically insert a variable whenever a new script_tab is opened?

Hi,

can anyone tell me why the script_editor even in the most up-to-date version (11.2 SR9 or so, I had the newest client installed) cannot recognize that variable call

(in the line where there is just >>  $(v_Tabchange)  <<)

=> That is underlined in red and so is the next LOAD statement though it is absolutely correct.

That's not a big problem as the LOAD works well. It is just a little bit annoying.

Best regards,

DataNibbler

Highlighted
MVP & Luminary
MVP & Luminary

Re: Automatically insert a variable whenever a new script_tab is opened?

Hi DataNibbler,

it's only a inadequacy from the editor not to recognize valid code.

- Marcus

Highlighted
Champion
Champion

Re: Automatically insert a variable whenever a new script_tab is opened?

Hi Marcus,

you're right. That happens if you put a valid line of code wholesale into a variable and then execute that by putting that variable in the $() and evaluating it. I have that in another place with delete_variables.

I also had it quite a while ago with the >> -= << in set_expressions - that was underlined, so no one could have said if the code was otherwise correct or not, so I replaced that with a slightly more lengthy expression that the editor recognizes.

But when going through the code in the Debugger and looking for errors, it is a bit irritating.

Why hasn't Qlik issued a patch for that yet?

Highlighted
Champion
Champion

Re: Automatically insert a variable whenever a new script_tab is opened?

Is there any way I can access the name given to a script_tab?

That info must be somewhere for QlikView inserts it into the log automatically. But can it be accessed?

Thanks a lot!

Best regards,

DataNibbler

Highlighted
MVP & Luminary
MVP & Luminary

Re: Automatically insert a variable whenever a new script_tab is opened?

Hi DataNibbler,

outside from the script you could read the script per macro and identify and count the tabs but inside from the script I don't believe that there is a way. The script is from the API-side one piece and the tab-splitting is only a window-feature from editor.

I use for this reason: let vTabName = 'MyTab';

- Marcus

Highlighted
Champion
Champion

Re: Automatically insert a variable whenever a new script_tab is opened?

Okay,

thanks!

Of course, with the help of an additional variable, it would be possible to include in the TRACE statement the name of the next-to-come tab.

That would be a good way to go. The issue is just that every such  change in the "general standard of scripting" - meaning things that should actually have been done from the beginning - is quite a lot of effort to roll out.

I will give it a think, however.

Best regards,

DataNibbler