How to filter a range of dates in emeditor - emeditor

How can i use Advanced Filter to extract a range of dates from a Column (eg: Btw 25/09/2021 & 27/09/2021) in Emeditor?

Please use multiple regular expressions combined with Logical Disjunction (OR) to filter a range of dates.
For example, if you want to extract dates from 23/07/2021 through 30/07/2021, you can use:
2[3-9]/07/2021 OR 30/07/2021
There are some articles of regular expressions for a range of dates:
However, the advantage of using EmEditor is that you can define several regular expressions and combine them using Logical Disjunction (OR), so that search expressions can be simplified.
It is possible that EmEditor might support date ranges natively in future versions.
Updates:
v21.2.901 (and later) supports date ranges natively.

Related

Replicate "Countif" in PowerBI using DAX

I am a new user to DAX and Power BI, but I am familiar with Excel. I want to replicate these countif formulas in DAX. In Excel, they are counting how many times a specific text string (in this case, the name of a brand) appears in the column, for example:
=COUNTIF(BH2:BH31,"Brand_A"), it is counting how many times the text "Brand_A" appears in the selection.
and I would like to know how I can do this in DAX in PowerBI. If anyone would be interested in providing some sample code I could try out, that would be very helpful.
You will likely want something like the COUNTX or COUNTAX function, combined with a FILTER, to replicate the functionality of Excel's COUNTIF.
https://learn.microsoft.com/en-us/dax/countax-function-dax
https://learn.microsoft.com/en-us/dax/countx-function-dax
Eg.
=COUNTAX(FILTER('YourTable',[BrandColumn]="Brand_A"),[BrandColumn])
Power BI's different "COUNT" functions have slightly different criteria in terms of whether a row gets counted or not (based on whether it's considering purely "empty" cells, or how the expression is evaluated), so you'd need to check the docs for each function and work out which one suits your specific requirement
(And by the way, a Google search of "Power BI COUNTIF" will give you plenty of results where you will find a range of different examples that should help)
You can use this calculation (COUNTX may be slow, because its a iterator) :
CountIf = CALCULATE( COUNTROWS('YourTable' ), FILTER(ALL('YourTable'), 'YourTable'[Brand] = "YourBrand"))

SORT in JCL based on Current Date

Requirement: I need to sort an input file based on Date.
The date is in YYYYMMDD format starting at 56th Position in the flat file.
Now, the I am trying to write a sort card which writes all the records that have the date(YYYYMMDD) in the past 7 Days.
Example: My job is running on 20181007, it should fetch all the records that have date in between 20181001 to 20181007.
Thanks in advance.
In terms of DFSort you can use the following filter to select the current date as a relative value. For instance:
OUTFIL INCLUDE=(56,8,CH,GE,DATE1-7)
There are several definitions for Dates in various formats. I assume that since you are referring to a flat file the date is in a character format and not zoned decimal or other representation.
For DFSort here is a reference to the include statement
Similar constructs exist for other sort products. Without specifics about the product your using this is unfortunately a generic answer.

Is there way to loop in NiFi expression language to add padding to the data?

There is a date field in the record. That is in the format below "YYYY-MM-DD HH:MM:SS.sss"(using this date value as a string). In some records, the milliseconds are rounded off from the source for example
2018-05-15 15:30:20.123
2018-05-15 15:30:20.12
2018-05-15 15:30:20.3
Is there a way to pad the additional zeros in example 2 and 3 like below in NiFi?
2018-05-15 15:30:20.120
2018-05-15 15:30:20.300
Is there way to loop in NiFi expression language?
PS: Right now I am using three different processors to do this loop by having the date as an attribute and check its length as a condition and decide to add '0' if needed. And another approach I tried is using an Execute script processor. But trying to find if there is a better solution to this?.
assume you have attribute date = 2018-05-15 15:30:20.3
you can use updateattribute with expression like this:
${date:append('000'):replaceAll('(\\.\\d{3})(.*)$','$1')}
append extra zeros and then remove the needless with regexp replace

Oracle BI (OBIEE) - Wildcard search for numeric values only

I need to set up a query that returns only the values that would match a pattern {Any character & digit}
I've tried setting up a filter criteria to ' %_
[0-9] but it doesn't work...I want to exclude any results that have two letters as the first two characters of a value.
Thanks!
In the presentation column, you can use the OBIEE - Evaluate - Embedded DB Functions in a formula.
For example (not the exact regex you are looking for but you get the point):
This link contains the same image/example I uploaded, as well as a few others: http://gerardnico.com/wiki/dat/obiee/regexp_evaluate

For Hive partition based on date, why use string type? why not int?

If I'm defining a table in Hive, and will be partitioning based on date, and my dates are in the format YYYYMMDD, which should I choose for the type, int or string?
If it was just a field, and therefore in the files I'm supplying for the table, I could see using a string, even if only so that I can search for and identify malformed entries that might work their way into my data. But since I will be specifying the partition as part of the load process, I know I'll always have correctly formed values.
When used in a Where clause, the partition field will normally be equality or less-than/greater-than logic.
Dates are typically treated as strings in Hive. If you look at all the date manipulation UDFs available, they use string types, so if you were using integers you would have to cast them every time.
Conceptually also I think it makes more sense to use strings, your YYYYMMDD is just a literal representation of a date object, but it is implicitly equivalent to something like YYYY-MM-DD or DDMMYYYY. So if you were using an integer here, it becomes painful to do such comparisons.
Note that you can also compare strings in Hive with equality/greater/lower-than operators, if you want to select a range of partitions you can easily do that with these operators.
The only case I would see using a "date" as an integer is using a timestamps (Unix-style) because it is a continuous value and represents a real measurable quantity.
Because YYYY-MM-DD is the standard for date representation and is the output of hive's to_date() UDF
it also allows you to do lazy things like select * from foo where day>'2013'
http://xkcd.com/1179/

Resources