Compare dates in xpath 1.0 - xpath

How to compare the dates in xpath 1.0 which is in format like 26 oct 2012. In that I want to
select only those nodes whose date > '26 oct 2012' . and date in nodes are in format 2 Nov
2012, oct 2012.
Is it possible in xpath 1.0. Please give me any solution.

On .NET you could write your own extension XPath function that would know how to handle these. The easiest way to compare dates in XPath 1.0 is to convert them to YYYMMDD format and compare as numbers (or strings). Again, I don't have any context on how you use your XPath but if this was in Xslt it would be doable.

Related

Is there a way to keep Month Data from May 2019 to Jan 2020 in powerbi Bar chart

I have an excel data with Data(from May 2019 to Jan 2020), few columns have been added in power bi mainly Month Number and Month Name.
For Month Name, sorting has been done by Month Number.
However, when i put the Bar graph, and sort it i get the bar graph from Jan 2020, May 2019, June 2019, July 2019 so on until Dec2019.(Image has been attached)
Do we have any way where we can put the graph starting from May 2019 all the way to Jan 2020 in x-axis.
I would suggest creating a date field and using that in the chart instead. The calculation could be something like:
Month New = DATE([Year],[Month Number],1)
Then you can customize the date field to just show the MMM-YY part. This way your sorting issues will be resolved and you won't face any issues in the future as well.

How to find week of the year for the date value?

My Flow having attribute '05-05-2015'.And i need to find week of the date in NiFi.
For example:
if date is 05 then it is belongs to 1st week of the year.
I shouldn't use Script/Program for find out week.
i need to find out that using NiFi Expression language only.
Can anyone suggest way to do that?
assume eee is your attribute
then expression
${eee:toDate('MM-dd-yyyy'):format('u E')}
output:
2 Tue
format reference:
http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

How do you parse a HTML table representing time?

I am attempting to parse this HTML table representing a year's worth of temperature data, provided by an Australian government website.
This table is set up in an unusual way: the columns are months, and the rows are days of the month (so the first row's cells are JAN 1, FEB 1, MAR 1). Each cell contains a number if there's data recorded for that day, an empty cell if no data was recorded, or a cell class notDay if the day does not exist (eg Feb 31st).
My intent is to build a database full of this data in the format
DATE RAINFALL MAX TEMP
2015-02-07 35 31
2015-02-07 40 17
My question is: what would the simplest or most efficient (in terms of programmer efficiency) way to parse the table to get the data into a usable format?
I'm personally using Ruby with the Nokogiri library, but general non-language-specific algorithm/approach advice is welcome if it makes for a better discussion. I'm not looking for someone to write the code and solve the problem for me, but for advice about the approach to take.
I wonder if you can:
Take all the cells in the order they appear:
Use Array#flatten if you've got an array-of-array situation.
Discard any notDay cells with Array#reject
Iterate over all the relevant dates using a date range:
(Date.new(2014,1,1) .. Date.new(2014,12,31)).each {...}
And go from there...?

Crystal report sorting by custom date

I'm having a doubt in how to sort a chart by custom date in Crystal Reports.
My Sql returns this for exemple:
Date
2013 Set
2013 Set
2013 Out
2013 Nov
I get this value using Decode, the code is above
EXTRACT(YEAR FROM S.sol_datachega) || ' ' || decode(EXTRACT(MONTH FROM S.sol_datachega),1,'Jan',2,'Fev',3,'Mar',4,'Abr',5,'Mai',6,'Jun',7,'Jul',8,'Ago',9,'Set',10,'Out',11,'Nov',12,'Dez') as mes
But x axis in my crystal reports sort by the string, so the chart comes like this:
2013 Nov
2013 Out
2013 Set
If i take the decode off the chart comes right
2013 09
2013 10
2013 11
But i need it with the name of the month instead of number.
I believe i can do this using formulas but i don't know how to do it because i'm new in crystal reports.
Any idea?
After doing some testing myself, it seems that there are limitations to what you are trying to achieve. Ken Hamady has an excellent write-up on the ways and limitations to formatting chart dates. Please see his write-up here and hopefully it will help you.

which dates given week number, bash

In Bourne shell, I need to know which dates belong to the same week. For example, week 16 in 2013 starts on April 22nd and ends on April 28th. Using the "date" command I can get the week number for a certain date but I need to go the other way around.
Thanks
A cheap way to obtain week numbers - Use ncal, the week numbers are output below calendar
e.g.
ncal -w 4 2013
or
ncal -w 2013

Resources