Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want to write a function that calculates a date based on 2 variables.
In VBA, I'll have:
Function GetDate(i as date, j as string)
GetDate = if(j = "NE", date(2015,1,1),
if( date(year(i), month(i), day(i)) < date(2014,1,1) , date(year(i), month(i), day(i)), date(2014,1,1)))
End function
Then I'll call the function in VB as:
SELECT X as Name,
.....GetDate(Birthdate, City), ..
......
My question is how to translate the same function above in Qlikview. Specifically, my questions are:
1. How to call the GetDate function in the load script
2. Where to set the variable type (i as date, j as string). I experimented in the module editor for Qlikview but somehow using
function GetDate(i as date, j as string)
doesn't work..
Thanks for any help any one can give me.
Hi,
Check this sample file for solution, you can call VB macros in Qlikview scripting
Calling VB function (macro) in Load script to find common string length in two strings
Hope this helps you.
Regards,
jagan.