Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

initiate macro from script?

Hey qlikview proffesionals. I'm new to qv and would like to use VB syntax instead of that in the "normal" script mode. I have a datafile to treat with the ending .qvd and from that I would like to extract some information. So I'm guessing the way to go (if i want to use VB syntax) is to load the file from a script and then initiate the macro somehow.

Also would like to know if it's possible to make use of arrays when I write code in qlikviews script?

Sorry for newbie questions but I'm sure there are some of you that enjoys helping! (And yes, I've used the search function)

4 Replies
Gysbert_Wassenaar

I strongly recommend you use the qlikview script language as much as possible. It offers a large amount of extremely useful built-in functions. Trying to do without those is a big mistake imho.

You can create functions in vbscript in the macro editor. The functions you create there can be used in the script. See here for a simple example. Subs (subroutines) cannot be used in the script. However the script can't access any UI elements like sheets, sheet objects, bookmarks etc. Those are not available during a reload. The vbscript language includes arrays so you can use them if you want.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert!

My problem at hand is actually one of time optimization, so using built-in functions in qlikview script is probably a lot better than using VBscript. I'm assuming the latter would cost unnecessary time if a solution is at all possible in qvscript.

Is it possible in qvscript to fill arrays (or somethin else) with data from a file I've loaded and then count when the same combination (from the same loaded file) comes up again? Probably being a bit unclear now., but I want to extract certain pieces of information from a large file and then count how many times that information shows in the file again.

Ty for showing me how to use functions like that:)

Gysbert_Wassenaar

That sounds like something you should do in the UI. Once you've loaded your data add listboxes for the fields to select your certain pieces of information. In the lower right corner you can see how may records you have and how many are filtered, e.g. F: 177/1054 would mean 177 records out of a total of 1054 match your selections.

If you need that number for other calculations there are ways to calculate it, both in the script and in the UI.


talk is cheap, supply exceeds demand
Not applicable
Author

Im taking it UI means user interface. I would like to completely automate the process and would not like to use the UI at all. Is it possible to use all functions that are usable in the UI, in the script?

It seems coding in qvscript is quite different from vb and java syntax, which are the two languages I'm somewhat used to.

Do you know of any good tutorial for writing code in qvscript?

Thanx