This content has been marked as final. Show 2 replies
I'm a newbie in qlikview hoping to learn from y'all. I have this question that I hope someone could help point me to the right direction.
I'm trying to achieve the same result in qlikview by using this sql example:
The TEST looks like this:
My SQL statement will look like this:
Declare @@dtPublished varchar(10)
--Select @@dtPublished = '7/1/2002'
select * from test
and (@@dtPublished is null OR dtPublished >= @@dtPublished)
If I don't pass a value to @@dtPublished variable, it should return all records with bSold value = 1 (basically, ignoring the and(@@dtPublished...) statement:
If I uncomment the "Select @@..." part, and pass @@dtPublished = '7/1/2002', it should return:
AuthID BookID bSold dtPublished
A01 XX001 1 7/1/2002
A01 XX003 1 4/4/2010
Now, instead of passing the @@dtPublished, I created a variable in "Test.qvs", which I called vardtPublished=Null();.
My load statement looks like this:
From '..\Test.qvd' (qvd)
and ( if ( NOT (ISNULL($(vardtPublished))), dtPublished>=$(vardtPublished)))