Thanks a lot Roberto and Mohammed Own for your help.
Sorry for extending this discussion. I have an issue regarding this.
I have to display a default Year. The default Year is displayed in such a way that today's date is checked to find out under which start date and end date it falls and that year is displayed as default Year.
eg: Today's date is 18/06/2012 and it falls between the range 01/04/2012 to 31/03/2013. Hence the default year to be displayed is F13.
Can you help me regarding the same.
How do you have to display that?
You mean in a chart or something?
Could you post a sample-qvw with an indication where your problem lies? Then lets see how I can help...
For me it is now unclear if your issue is still in the load-script, or if you want to have some "initial selection" based on the current year; I hope you can elaborate a bit.
No Roberto. That's not what I was looking for.
Let's consider this example.
Today's date is 18/06/2012 . The default Year that is to be displayed is F13.
If today's date is 01/01/2013 then the default Year that is to be displayed is F13.
I think we have to check under which start date and end date range today's date falls under and we have to display the Year(Financial) accordingly.
Another try... If that is not what you're looking for, perhaps some of the others can try to help :-P
- Find the attached qvw
- note that when the variable vTestDateToday is set to a new (test)value AND you switch between sheet1 and Main... the (as far as I understand your problem correctly) right selection is set...
- The reason is that I defined (at sheet level) a trigger to do the selection and applied some setAnalysis to figure out which year to take
So what I wonder is:
 does it pick the right year for every inputdate that you test with? (if not, what is my misunderstanding)
 does this fix your problem?
Hope it helps :-)
InitialSelection.qvw 153.5 K
Thanks a ton!!
That's what I was looking for.
Can you let me know when only() function is used!!
might sound a bit silly to you:)
I'm very new to QlikView and i'm in the process of learning Set Analysis.
About the only-function:
This is what the reference manual says about it:
If expression over a number of records, as defined by a group by clause, contains only one numeric value,
that value is returned. Else, NULL is returned.
In my own words
- I use it when the outcome must be exactly one value (if it is more, Null() is returned, which is usually not useful)
- It is an aggregation-function, so you can apply setAnalysis in this function
- I use it for a case like this, where the "logic" is such that when the filters are applied correctly, there is only one record / value to return
For setAnalysis there are good references online; this one I like most of them; I'll attach it here.
If you would have questions on SetAnalysis, I suggest you open a new topic, since that would be offtopic for this one :-)
SetAnalysis.qvw 1.7 MB