Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
is it possible to define a function into the QV script? If yes, a simple sample, please.
Thanks
pscorca69 - Please read the below post. I got it working with Variables and it is fantastic solution by Tim.
http://community.qlik.com/forums/t/43601.aspx
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 [
Holiday
3/15/2010
3/10/2010
2/15/2010
1/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))';