Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
I'm facing a strange problem not able to troubleshoot it where the mistake is.
In my dashboard i'm showing last three years in list box, under that showing calendar objects from selecting the data range.
My requirement is in on active sheet max year should select in listbox and in the From calendar, Date(Yearstart(Max(Date_Field))) to be selected and in the To Calendar Date(Addmonths(Max(Date_Field),0)) need to select .
If i select 2014 , the calendar object should change from 01/01.2014 to 31/12/2014 dynamically.
The above one i achieved. The problem is , the above task i achieved in my personal desktop. When i'm trying to do the same thing in the client's server it's not working. Each and every variable i did a copy & paste. But, it's not working.
Qlikview i'm using personally is 11.20 SR10
My Clients Qlikview is 11.20 SR5
Is this the problem?or anything.Please suggest me .
Regards
Krishna
I think the main problem is that you have assumed that YearStart() returns a date value. The function actually returns a timestamp, so you need to numerically transform that into a integer to match you date values.
Date(Round(Yearstart(Max(Date_Field))))
EDIT: The timestamp decimal can be forced to integer by using Round().
Are you saying that the QlikView documentation/help decided to digress from reality again?
QV Help tells me that YearStart returns the timestamp of the first millisecond of the year, which is 00:00:00.000. IIRC that value translates into a zero fraction.
You know something that we don't?
Peter
Actually my date is in time stamp format from database. That's the reason choosing Yearstart().
Well, it does not matter if your incoming format is timestamp. The output form YearStart() is still a decimal value, and you need to ensure it becomes a properly formatted date.
Actually, considering the floating point value I have edited my suggestion above.
Of course you were right about the Date(). I was just talking about the Floor() function which - AFAIK - doesn't return an integer.
BTW you're sure you want to state that Date(YearStart()) occasionally returns Dec 31st in QlikView?
Floor() and Round() returns a number. This number will be a integer if you use the default base and offset.
num floor(x [ , base [ , offset ]])
num round( x [ , base [ , offset ]])
The 31 Dec is the consequence of when the YearStart() timestamp round downwards, as in my example 40522.999999999999. This s why I changed my previous comment to Round(), as this will correct the rounded integer to 40523.
Hi Tony,
Can you please apply this logic in my sample app SR5. Because , using yearstart() working correctly in SR11 app. Little confused.
Does it make any difference if you add the Round() ?
No Tony, I need to see correct format date in Calendar object.It's not converting or round the digits.