Thanx for your reply,
I have done with list boxes as you suggested , but as data is huge and expressions are large ,
The proccessing time is more and CPU utilisation becomes more because of that application get stuck so i want to reduce data for fast processing
is it possible please suggest for any macro is there in Qlikview to do that .
Why don't use a Master Calendar as suggested in the Developer Course? Take a look at the example to see if that can suits you.
//************** Quarters mapping Load **************
rowno() as Month,
'T' & Ceil(rowno()/3) as Quarter
LET varMinDate = Num(Peek('OrderDate', 0, 'Orders'));
LET varMaxDate = Num(Peek('OrderDate', -1, 'Orders'));
LET vToday = Num(today());
//*************** Temporary Calendar ***************
$(varMinDate)+IterNo()-1 AS Num,
Date($(varMinDate)+IterNo()-1) AS TempDate
AUTOGENERATE 1 WHILE $(varMinDate)+IterNo()-1<= $(varMaxDate);
//*************** Master Calendar ***************
LOAD TempDate AS OrderDate,
week(TempDate) AS Week,
year(TempDate) AS Year,
month(TempDate) AS Month,
day(TempDate) AS Day,
weekday(TempDate) AS WeekDay,
applymap('Quarters_Map', num(month(TempDate)), null()) AS Quarter,
date(monthstart(TempDate), 'MMM-YYYY') AS MonthYear,
week(TempDate)&'-'&Year(TempDate) AS WeekYear,
Year2Date(TempDate, 0, 1, $(vToday))*-1 AS CurYTDFlag,
Year2Date(TempDate,-1, 1, $(vToday))*-1 AS LastYTDFlag
ORDER BY TempDate Asc;
DROP TABLE TempCalendar;
Now with three listboxes you have all relevant dates to search.
P.S.: For copyright purposes, this code is not mine, it is used in the QlikView Developer Manual and exercises.
not sure if you have solved this or not, but I saw a demo application that had a slider used to select a date range.
I sometimes have to select a range of months (e.g.rolling 12 months), so have created a new concatonated field by appending the month to the year,
I found this can be used in a list box to select a range. With you, you are choosing specific days too, so have a look at the demo apps, you may get some inspiration. I cant remember which one it was though..
I solved this with use of a macro. First i created a DateRange table with only one field, DateRange (this one i autogenerated out of max(Date) and min(Date) from the actual date field.
I when created to variables, vDateStart and vDateStop. Two calendar objects was created, one for each variable with min(DateRange) and max(DateRange) as limits. A button triggers a macro that does a
obj.Select ">="& ActiveDocument.Evaluate("date(vDateStart,'YYYY-MM-DD')") &" <=" & ActiveDocument.Evaluate("date(vDateStop,'YYYY-MM-DD')")
You can of course skip the dateRange part and just let the user input the two dates into a input box, but the Calendar object are quite elegant and easy to use (with an inputbox the user can always input the date in a wrong format.
Here's a version 9 macroless (uses Actions) solution that uses Input Boxes. It validates the input to ensure format and in the correct range.
I have a version 8 version that uses macros if you are on V8. (Search the Forum for EnerDateFromTo.qvw)
EnterDateFromToV9.qvw 138.8 K
Rob, your solution here is excellent.
QlikView gave me something similar but it was way more primitive and unfinished and used macros.
I have implemented your solution on one of our documents and it works a treat. Will be rolling it out to our other documents, I'll give you a credit in the code.
rfarrenkopf wrote:unable to find you V8 version (EnerDateFromTo.qvw) by searching the forum. Could you point me to the correct location?
You'll find the version 8 sample in this thread:
BTW, a better way to search the Forum is Google with a site: filter. I went to Google and entered the search argument:
I implemented the input boxes and triggers on my application following the code that you had in your solution but I have a problem. Is there a way to clear the input boxes using the clear button that is in the QlikView toolbar? When I click Clear, it clears everything except the input boxes and the date list associated with them.
Ken wrote: Is there a way to clear the input boxes using the clear button that is in the QlikView toolbar?
You could remove the OnChange action from the Date field if you want Clear to "Stick". To clear the input fields, you would need a some hidden field you could detect clear (OnChange) on and set the variable values.