Discussion board where members can get started with QlikView.
is it possible to define a function into the QV script? If yes, a simple sample, please.
pscorca69 - Please read the below post. I got it working with Variables and it is fantastic solution by Tim.
Cheers - DV
Is the above post helpful? Please share if you find more information...
Here's an example of creating a couple functions in the script using variables. It's also an example of building functions from an inline table, which isn't something you need, but hopefully you can recognize what's what and get the idea.
[Holidays]:LOAD * INLINE [Holiday3/15/20103/10/20102/15/20101/1/2010];
AllHolidays:LOAD concat(num(Holiday),',') as AllHolidays RESIDENT Holidays;LET customfirstworkdate = 'firstworkdate($1,$2,' & peek('AllHolidays') & ')';LET customnetworkdays = 'networkdays($1,$2,' & peek('AllHolidays') & ')';DROP TABLE AllHolidays;
Edit: A couple simpler examples from a sample currency conversion script:
LET money = 'money($1,only(CurrencyFormat),only(Decimal),only(Thousand))';LET date = 'date($1,only(DateFormat))';