Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a qlikview file with section access. After opening it I reload the file with only record's with the filter for the user . Now I want to apply a filter for date, It should be like after section access & before reload. It should ask me Input for Start Date & End Date and should load data only for that duration. I can use Input box in Macro but the user may enter wrong value & that can cause trouble. How can I accept input without any problem's. Any ideas on that.
Thanks in advance for your valuable input's
Regards
Amar[:'(]
The attached example checks the Start and End dates to be valid dates, and if the End date is later than Satrt date.
Hi,
what do you think about a Calendar Object?
Rainer
Thank's Rainer.
But How to call a Calender object & accept the value in a variable. If you have any example plese let me know about it.
Regards,
Amar
Amar,
see the application I attached.
The macro part is not perfect. Maybe one of our more experienced colleagues can help out here.
Rainer
Thank's Rainer,
But sorry , I know this is some what discouraging but this is not exactly as what I wanted , I want to pop up a calender object or something in which I can enter date (without error) from a macro.
Thanks Again for the kindness.
Regards
Amar
I'm not sure there is a clean solution. Can you try this logic:
1. In the script, call the Input box. User enters some date.
2. In the script, check if this is a valid date.
3. If yes, go to p. 6.
4. If not, open another input box, probably with some meaningful message for user.
5. Go to p. 2.
6. Continue.
You should also check if ther End Date is later than Start Date.
Thank's Michael,
I will try this.
Regards
Amar
You can use standard InputBox objects with a custom constraint that tests for a valid date.
=NOT IsNull(date(date#($)))
Error message is also supported in the constraint. See attached for an example.
-Rob
Yes Rob,
I'm also using input boxes for dates, combined with macros that check the vlidity of the input - it must be a date, possibly within some range, and Start date must be earlier than End date. I think your solution is more robust, I'll take a closer look.
As for Amar's question, I think that he wants to enter dates on reload. Not sure now if I got the question right.
Yes michael ,
I want it that way only. I already have used it in one of my example where in input box I accept date by using
set EnteredFromDate = ActiveDocument.GetVariable("vDate")
FromDt = Inputbox("Please enter From Date in MM/DD/YYYY format","From Date",EnteredReloadFromDt)
If Not IsDate(FromDt) Then
Msgbox "Invalid Date"
FromDt = "01/01/1900"
End If
but I was not able to use goto label in this. If you can tell me that?
Thanks for your valuable inputs
Regards
Amar