Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone:
This is my first post and I am new to Qlikview.
I hope that I can get some help for my problem.
How do I know the start date and end date of the current selected period (selection in a calendar list box)?
Thank you very much.
PC
Hi,
The Calendar would have been created from a field like Date. If you just put that field in a list box you will see all the dates that are applicable for the calendar selections. You could also use Min(Date) and Max(Date) for Starting and Ending dates for the selections.
Thanks
AJ
Yes, I think Min(Date) and Max(Date) is probably what you are looking for.
Also have a look at the QV date and time functions listed in the HELP, there are many functions that might help you to calculate start and end dates for a certain period for a given date, like weekstart() / weekend(), monthstart() / monthend(), quarterstart() / quarterend(), yearstart() / yearend(). Please have a look into the Help file for more detailed syntax description.
Hi AJ:
Thanks for the quick response!!
What if my list box looks like this:
And the fields are created using: Year(Date), Month(Date), etc.
What I want is a formula that would give me 01/01/2013 and 31/12/2013 if I choose 2013 in Year.
Or 01/01/2013 and 31/01/2013 if I choose 2013 in Year and Jan in Month.
Thank you.
PC
Yes min and max will give you the results if 01/01/2013 and 1/31/2013 are in the date field.
Example:
Date
1/1/2013
1/10/2013
1/21/2013
1/26/2013
1/31/2013
Now Month(Date) will give your Jan and Year(Date) will give your 2013
If use Min(Date) and Max(Date) you will get 1/1 and 1/31
Thanks
AJ
Hi:
I've try Max(Date) and Min(Date).
But it only return the begin and end of the field 'Date' and they are fixed.
They will not change if I change the Year in the list box.
Thanks
Hi
Thank you very much for your reply.
I did some research online and I think my answer might involve something like GetCurrentSelection() and SubStringCount().
I just need to spend some time to explore a bit more.
Cheers,
Pc
Hi:
Thank you very much for your reply.
PC
Hi all:
I just realised I made a mistake.
When I said List Box, I mean Multi Box.
Sorry.
PC
I'm also struggling with something like what you describe. I've the years 2012, 2013, 2014.. And given one of those years, i would like to know if there's a built in function to give me the minimum and maximum date for them.
Ex: Given the year 2013 - user selects this year.
I have to make an expression like Client_Creationdate = {">= minimumdate(year2013) <= maximumdate(year2013)"}
is there any function for that?
Thanking you in advance.