Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Create a personal function

Hi everyone!

I've been working with QV for some weeks and this is my first post.

I want to know how to stablish personal functions in QV to call them on Load part.

For example:

Function Calc (...);

Load Calc (Customer_type) as NewType

From qvd (qvd)

where Customer_type = 1;

Is possible to do this?

Thanks a lot

1 Solution

Accepted Solutions
MVP
MVP

AW:Create a personal function

Hi,

you can only create personal functions in VB script which can be used in QV script.

function calc (ByVal customer_type)
... do something
calc = result
end function


But I would suggest always to try to use build in script functions first for performance reasons.

- Ralf

11 Replies
MVP
MVP

AW:Create a personal function

Hi,

you can only create personal functions in VB script which can be used in QV script.

function calc (ByVal customer_type)
... do something
calc = result
end function


But I would suggest always to try to use build in script functions first for performance reasons.

- Ralf

Not applicable

AW:Create a personal function

For that performance reasons I prefer to do that in QV, but seems that it's not possible to do a function at the begining of the QV script to be called after.

Thank you, Ralf.

MVP
MVP

AW:Re: AW:Create a personal function

You can do a lot of interesting things with QV mappings...

- Ralf

Not applicable

AW:Re: AW:Create a personal function

I think you can also do some kinf of function using sub() for example.

But in this case you can only do QV things such as calculate specific values in tables, create tables, update variables, etc..

Sébastien

Not applicable

AW:Re: AW:Create a personal function

Sébastien, sub function seems good, but it's not possible to use "call" into load part.

"Load call function(parameter) as result_function From file.qvd (qvd)"

I want to do something like that...

Thanks! :-)

Not applicable

AW:Re: AW:Create a personal function

You're right but in some case you can do a loop and for each loop retrieve the result in a variable then use this variable in the field...

I don't know if it can be an easy solution comparing to vbs but why not..

MVP
MVP

AW:Create a personal function

Pepe,

I found another way to do this in the forum: http://community.qlik.com/forums/p/18140/70878.aspx#70878

Also see the attached example udf.qvw!

- Ralf

Not applicable

AW:Create a personal function

No Attachments Smiley Sad

MVP
MVP

AW:Re: AW:Create a personal function

follow the link...