So I would like to know what now-1y is producing as a result. So is it:
now - 365days
now - 365.25days
now with the year part subtracted, so 2014-12-23T08:46:00
I've read this documentation but can't find any more information.
After some testing it appears that the third proposition is correct (ie "now with the year part subtracted, so 2014-12-23T08:46:00"
If 2 was correct the following example should have return 2 results.
example1
As 2012 is a leap year. The following example should return 0 result if 1 was correct.
example2
Note: example only worked as expected when I wrote this answer, in order to make it work for you, you have to update the date field of the indexed document.
Related
I'm using Google Sheets as web scraper.
I have been using this IMPORTXML
=importxml(A1, "//div[#class='review-content']//text()")
and this is the results
Row1: {"publishedDate":"2019-01-05T22:19:28Z","updatedDate":"null","reportedDate":"null}
Row2: {"publishedDate":"2018-12-10T22:19:28Z","updatedDate":"null","reportedDate":"null}
Row3: {"publishedDate":"2018-12-09T22:19:28Z","updatedDate":"null","reportedDate":"null}
but am having trouble figuring out how to get only the "publishedDate" value.
Example:
Row1: 2019-01-05T22:19:28Z
Row2: 2018-12-10T22:19:28Z
Row3: 2018-12-09T22:19:28Z
Any ideas as to what I may be missing
How about these 3 samples? I thought them from the samples of your question. I think that there are several answers for your situation. So please think of this as 3 samples of them.
It supposes that the URL is put in the cell "A1".
Sample 1:
=ARRAYFORMULA(MID(IMPORTXML(A1, "//div[#class='review-content']//text()"),19,20))
When the length of string of each value is the constant, how about this?
The value is retrieved by MID().
Sample 2:
=ARRAYFORMULA(INDEX(SPLIT(IMPORTXML(A1, "//div[#class='review-content']//text()"),"""",TRUE,TRUE),,4))
When the position of each value is the constant, how about this?
The value is retrieved by SPLIT() and INDEX().
Sample 3:
=ARRAYFORMULA(REGEXEXTRACT(IMPORTXML(A1, "//div[#class='review-content']//text()"),"publishedDate"":""(\w.+?)"""))
When the pattern of each value is the constant, how about this?
The value is retrieved by REGEXEXTRACT().
References:
MID
SPLIT
INDEX
REGEXEXTRACT
If these were not the results you want, I apologize. At that time, in order to correctly replicate your situation, can you provide the URL you are using as #Rubén says?
I am making a program that will enable me to work out the avergae speed of something over a set distance
For this to work the user needs to input the start time and the end time.. I am not sure how you input time in a 24 hour format.
Furthermore I need to find the difference in the 2 times and then work out the speed.. which is distance/time taken.
Let's say distance was 1000 meters
I lack a bbc basic compiler but you should create some like this
print str$(secondsinday("22:50:01")-secondsinday("17:09:17"))
sub secondsinday(t$)
return val(left$(t$,2))*3600+val(mid$(t$,4,2))*60+val(right$(t$,2))
end sub
I saw some bbc basic examples and the formula should be the same, only the function syntax is diffrent (I'll try and convert it after some research)
I'm trying to use a relatively basic IF function but having no luck - i'm sure i just have brackets or parenthesis wrong or something. Reckon it will be childsplay for you guys....
The formula is intended to show how many days a date has passed by. Date is shown in T column.
Basically it was working fine as the following, both for pending and past dates:
=IF(T7<=TODAY(), (TODAY()-T7),-(T7-TODAY()))
But I got greedy and wanted it to return more of a statement when the date has passed, as to how much it has passed by. So I've tried to make this happen with:
=IF(T7<=TODAY(),"EffOut(TODAY()-T7) days ago",-(T7-TODAY()))
Hoping it would enter "EffOut 8 days ago" (when TODAY()-T7 is 8 days) for example.
But it doesnt - it shows the entire argument i.e "EffOut(TODAY()-T7) days ago" in the return cell.
Is it possible to have a kind of embedded formula in the 'value_if' fields, mixed with text in this sense?
Happy to share the document if that would help, but will need to clear the data first so just let me know.
Thanks in advance, any help is much appreciated! Having read other posts I think it will just be a simple fix but its well beyond me! (I only got this far by perusing forums...)
Maybe something like this...
=IF(T7<=TODAY(),"EffOut "&DAYS(TODAY(),T7)&" days ago",-(T7-TODAY()))
=IF(T7<=TODAY(),"EffOut "&(TODAY()-T7)&" days ago",-(T7-TODAY()))
You just need to be careful to put "" around any strings. This is how Excel knows that's not a part of the formula. Remember to out the spaces is to the string like I did above so it looks like a sentence. The & sign combines the results of the calculated parts and the strings.
I've got a strange behaviour on a German surname "Warsoenke".
Check this out:
create table test_warsoe
as
select 'Mister Warsoenke ABC-12' name
from dual;
create index test_warsoe_index on test_warsoe(name) indextype is ctxsys.context;
select name,
score(1) as rating_warsoe,
score(2) as rating_warsoen
from test_warsoe
where contains(name,'definescore(Warsoe%,occurrence)',1) > 0
or contains(name,'definescore(Warsoen%,occurrence)',2) > 0;
The output is:
Mister Warsoenke ABC-12 | 2 | 1
I cannot figure out why? If I type "Warsoe" or "War" it returns score 2. If I type "Warsoen" it works like, as I understand, it should and returns 1.
If I do not use definescore it works in the same direction, just shows different numbers (27 and 13).
For other surnames it works perfectly and clear. But for this one...
I had a guess this is because of German database settings, e.g. "War so e..." but this idea is quite strange and still it is not clear why "Warsoen" works then.
Any ideas?
EDIT
I've found out much more surnames which are not working like the described above. And I still do not see any possible explanation of this...
Just if somebody has the same problem, the problem was in setting of DEFAULT_LEXER:
BASE_LETTER | YES
ALTERNATE_SPELLING | GERMAN
That's what we received after investigation:
To change the behaviour, either one of the two parameters have to be changed, or the additional parameter OVERRIDE_BASE_LETTER has to be set to true (according to docs).
First of all I would like to apologize if this has been asked before, I just couldn't find the answer.
To the point:
My problem is as follows: I am using Crystal Reports for VS2010 and I have a field that should dispaly 1 or -1 based on an If check
If IsNull ({Orders.OrderReplacedBy})
Then 1
Else -1
It should display in my report 1 for null values of the field and -1 otherwise. Problem is that in my report I get only .00 no matter the value of the if test.
Furthermore I have another formula field that does of a sum of all the 1s and -1s showed on the report, and it seems to be working a little weird. In my database I have 772 total rows, of which 39 are NULL (so there should be 733 1s and 39 -1s with a sum of 694) and the displayed sum is 488. The code for the sum is as follows:
Sum({#N})
where N is the field where I calculate the 1s and -1s.
What I've tried so far:
changed the If test from IsNull to ToText({Orders.OrderReplacedBy})=""
changed the If test to {Orders.OrderReplacedBy}>0 as the OrderReplacedBy field in the database is numeric and there cannot be values less than zero, so the NULLs should just trigger the Else.
trid to change the display of the formula to "1" and ToNumber("1") nothing seems to work
I honestly have no more ideas of what else to try and I also have no knowledge of Crystal Reports (I am only working with it for 2 days and just need to modify a report on an existing app).
Any help would be appreciated,
Thanks :)
P.S.: I am working with Silverlight 4
Since no one answered I presume that this hasn't happened to anyone or isn't of much interest. But after doing some more research and trying out other stuff I've found a workaroud that I'll post (maybe someone else bumps to this, who knows?):
In the N formula (I don't know why it didn't work the last time I tried) I changed things like this:
If IsNull({Orders.OrderReplacedBy})
Then "1"
Else "-1"
Added a new formula that isn't used on the report called Numbers
If {#N}="1"
Then 1
Else -1
And then I changed the sum formula to match the intermediate field
Sum({#Numbers})
I still don't know the reason why the report didn't want to show me the numbers in the N formula, nor why the sum formula didn't calculate the correct sum.
I hope this is at least going to be useful to someone else,
Cheers!