Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I wanna put in my application a variable so my user can input a certain date. Then I need to filter all my data has the field sale_date < date_variable.
How can I make this filter after the input value?
Can be done by macro, something like this:
sub macro
set f = ActiveDocument.Fields("sales_date")
set v = ActiveDocument.Variables("date_variable")
f.Select "<" + v.GetContent.string
end sub
(I didn't test it, the could be some erros).
Regards,
Michael
Using set analysis like this:
sum( {<sale_date={"<$(date_variable)"}>} SaleAmount)
But this is to be used inside an expression, isn't it?
I want all data that has sale_date > date_variable not be showed.
Add a calculated dimension to the report: if(sale_date<=date_variable,1) and select Suppress When Value is Null and Hide the column.
If you want to enforse a selection (with the same effect as selecting the dates in a List Box), - currently you can only do it using a Macro. If you can wait till version 9, you'll be able to use Actions to do the same.
regards,
Oleg
Search the forums for "variables getcontent macro select" and you will see discussions with code samples.
Can be done by macro, something like this:
sub macro
set f = ActiveDocument.Fields("sales_date")
set v = ActiveDocument.Variables("date_variable")
f.Select "<" + v.GetContent.string
end sub
(I didn't test it, the could be some erros).
Regards,
Michael
Call me silly, but why not just use native QV associative technology. Create a table with a field which is a date field from Max(sale_date) to Min(sale_date), one value for each day (you can also create month() and quartername(), etc., to allow easy selection of months and quarters, etc.). Then join this new table to the sale_date field in the load script. Then the user can just select a date (or month, or quarter, etc)... and the whole QV will be filtered by this selection. I will post an example calendar load script to the share QV in a min.
Anthony,
It would be too easy... We here prefer to do things a hard way...
Or sometimes have to deal with the inflexible client requirements
Regards,
Michael
I have created a quick calendar example and put it in the shared area. Here's a link: