ga:YearWeek is different then =isoweeknum - date

I'm reading Google Analytics data into Google Sheets. The metric is ga:YearWeek - its current value is 201945.
But, if i try to get the current week number using =isoweeknum(201945) i get 48 instead of 45, which isn't correct value.
Ortherwise, if i use =isoweeknum(2019-11-04) i get correctly 45. What i'm doing wrong on querying =isoweeknum(201945)? I need 45!

you are passing it as a value so the date is far away in future...
value 201945 is equal to date: 25/11/2452
while date 2019-4-5 is equal to value: 43560
so yes, =ISOWEEKNUM(201945) to return 48 is correct value because the year is 2452

Related

The difference in strings in Tableau

I am using Tableau Server version 10.4.3
I have a dimension rTime which has string value. the entries in rTime is of like this
May 10, 2019 8:59:56.303 PM UTC
I want to check whether the rTime is today or not. I cannot use DateParse since my server doesn't have this functionality.
I created a calculated field CheckrTime with below content :
STR(LEFT(SPLIT([rTime],':',1),LEN(SPLIT([rTime],':',1))-2))
When I am dragging CheckrTime into workspace area, the output is coming in below format which is what I wanted :
May 10, 2019
When I am checking ISDATE("May 10, 2019") (a normal string), it is outputting TRUE as expected but when I am checking ISDATE(CheckrTime) it is outputting FALSE . Why?
The reason I am checking above thing is I am looking to use DATEDIFF function of tableau in this way:
DATEDIFF('day', DATE(CheckrTime), TODAY()) == 0
NOTE
If someone is wondering ,I have taken care of the level of granularity.
If you have a better solution then the one I am following, please do tell me.
This is working for me. I would expect May 10 <> May 16 (today) and therefore return false. However, when I change your example to today's date it does in fact come back as true.
You could also try this formula for the date LEFT([rTime],FINDNTH([rTime],' ',3)). It is slightly less complicated but will give you the same answer.
Calculated field (date type) depends the locale used which defines date format. Are you able to use Date function?
In Tableau website there is a example using english locale
For string 06May2017
DATE (LEFT([Original Date], 2) + "/" + MID([Original Date],3,3) + "/" + RIGHT([Original Date],4))
Above mentioned highligts / character between digits which is depending on locale

spss-modeler date difference getting negative results

First of all, I'm new to SPSS modeler, sorry if my question sound too obvious for experts, but what I'm trying is to calculate the date difference between two date values ( arrive_Date , Depart_Date ) in (Hours), I used this function time_hours_difference , this function works okay if the Arrive_Date and depart_date are the same day, but if the days are different, the date difference is in negative value, I searched and enabled this option: Rollover days/mins in stream properties, but the problem remains the same.
I hope you can help me with this beginner question.
Thanks
Hope its not too late. You are getting negative values because time_hours_difference extract only the time from the two specified timestamps and computes the difference out of it. It doesn't take the date values into account.
For example:
time_hours_difference('2012-08-02 14:10:50,2012-08-05 13:36:26)
Output:
-0.573
Remember, here time_in_hours('0130') under time format 'HHMM' evaluates to 1.5.
Here is my solution: in order to take days into account, first extract date_days_difference and multiply it with 24 to bring it in Hours and then sum it up with the time difference using time_hours_difference.
date_days_difference(arrive_Date,Depart_Date)*24 +
time_hours_difference(arrive_Date,(to_string(datetime_date(arrive_Date)) >< " 23:59:00")) +
time_hours_difference((to_string(datetime_date(Depart_Date)) >< " 00:00:00"),Depart_Date)

vb6 error 380 Datepicker, bust just in certain dates

Im having a problem with a datepicker on vb6, but this jus happen on certain dates, for example 31/01/2017, but with another dates it works fine.
I appreciate the help
This almost certainly has to do with how you are setting the date in the control.
For instance if the control's value is ANY month that does not have 31 days then you will get that error. Trying to set the control to 31/02/2017 would cause an error 380.
There are two approaches you can take to fix this.
Reverse the order you set the date components.
dtFecha.Year = Year(fcsAux.Fields("xf3ch4"))
dtFecha.Month = Month(fcsAux.Fields("xf3ch4"))
dtFecha.Day = Day(fcsAux.Fields("xf3ch4"))
Set the Value property instead of the date components. dtFecha.Value = "31/02/2017"
dtFecha.Value = rcsAux.Fields("xf3ch4").Value
The first approach ensures the month is always appropriate for the day. The second approach sets the entire value at one shot and should be a valid date.

How can i get only the date and time in selenium IDE

I'm using selenium IDE and i would like to capture only the date and time from a field that was updated
Example:
Updated by James in 07/05/2015 - 09:50
I need to get only this date and the time from the record updated
Is there a way to do this ?
Thanks
Well you can do it with storeEval(). You can use JavaScript to manipulate stored variables. Lets assume that you stored that whole text in variable updated
${updated} == "Updated by James in 07/05/2015 - 09:50"
Now we just need to get that variable and get part of its text:
Command: storeEval()
Target: storedVars['updated'].split(' ')[4]
Value: date
Basically we get updated and we split it into array using space as separator, and then we get 4th element of array, which contains date and store in it new variable date.
Now:
${date} == "07/05/2015"
The same you can do with time.

Symfony2: Form specify range of Date

I use date and datetime widget into my formular, but the default values doen't suit me.
I don't know how to specify a date range into my ObjectType.
on the one hand I want to change date to specify a date range:
for example
- from 2012-10-1 to 2022-10-1
On the other hand I want to specify the minutes like that
0 - 10 - 20 -30-40 - 50
Please help me
See ya
Sam
Just symply precise in the type 'years' value, and it will be ok :)