Get the current time in a dataflow - atrius-solution-builder

I'm building a dataflow where I want to filter rows based on the current time. I need to filter these based on the hour and minute.
I thought I could use a Date Time block. When I use that, the output value shows "today".
But when I bind the output of the Date Time block to the input on a Date Format block or my symbol, the value of the bound property is null.
I'm looking for a way to get the current date and time, preferably with a way to control how often the value is updated (once per minute would be enough for example).

Using a Script block works. The script to get the current timestamp with the precision of one minute as a string:
dateFormat(new DateTime(), "y-MM-dd HH:mm")
You can connect the output of the Script block to the input on a block that expects a "date", such as a Date Format block.
For the value to be updated, you must invoke the script block. To do this, a Stopwatch block can be used. In my case, I have it set to update every 10 seconds.

Related

Adding the value of a What If Parameter to a time value in Power BI

Using a what if statement in Power BI, I'm looking to use the value of the parameter to add minutes to a time value.
For example a time of 12:05, I would like to use a slider to add minutes to it so a value of 3 would result in a time of 12:08. Using the measure given by the parameter doesn't update the time field.
I have tried converting the time value to a whole number and vice versa but still no result.
Any help would be appreciated.

I want to concatenate milliseconds to date format in informatica

Dears,
I have a date value that has no milliseconds, and I want to concatenate System Timestamp milliseconds to that date.
I use GET_DATE_PART, but it didn't work.
What can I do regarding this?
Firstly generate the values in two ports. One for original date value and the other for sysdate value. Take a variable port and substring sysdate value until the date before the milliseconds and print just the milliseconds. Finally in the other port concatenate your original date value with milliseconds. If you can be able to post your codes, it would be more helpful to provide you relevant codes
Create a variable port in expression transformation with the below logic and pass it to the next level, like:
ADD_TO_DATE(i_DATE,'MS',TO_INTEGER(TO_CHAR(SYSTIMESTAMP(),'MS')))
Replace MS with NS if you want Nanoseconds.
Hope this helps!

hiveconf parameter, is it possible to set a value?

I have one hiveconf variable set as
set DATEHOUR = from_unixtime(unix_timestamp()-3000);
The idea is that log files are available in Hadoop 50 minutes (3000 seconds) after each hour, and this workflow will process them and store the transformed data into the correct partition. DATEHOUR is initially used to query to correct partition within the raw logs directory.
But after the transformation process (which could take a variable amount of time), I want to store the result in a different directory, but again in the correct partition. But if I use ${hiveconf:DATEHOUR} again, it grabs the current timestamp, not the timestamp from when I first set the variable.
I tried creating a new variable and setting it equal to DATEHOUR but it still returns the same problem. Is there a way I can "paste the value" of DATEHOUR somewhere so it remains constant for later retrieval?
You are getting that result because unix_timestamp() gives the current timestamp.
What you need is to subtract the 3000 secs from the datehour you set. So you need to put that value in your query. Your changed will look like this:
select from_unixtime(unix_timestamp('${hiveconf:datehour}')-3000) from <table>;
When this query runs it will get the value from the last datehour value you set. Also you need to set datehour value with the output for this query.
Hope it helps...!!!

How can I dynamically set the time period on a Workflow Time Trigger?

I have a custom object with Start and End date fields, and also a Status field.
When a new record is created, if the Start date specified is in the future, I would like to be able to have a Workflow update the Status field to 'Active' when the Start date is today. However, I only appear to be able to select a fixed number of days after which my Field Update task can be triggered. What I want is to set that number of days equal to Start date - Today's date.
Can this be done?
OK, I realised I can set the time delay to zero days after the Start date. Not intuitive (For me), but it makes sense.

Time value as output

For few columns from the source i.e .csv file, we are having values like 1:52:00, 14:45:00.
I am supposed to load to the Oracle table.
Which data type should I choose in Target as well as source?
Should i be doing any thing in the expression transformation?
Use SQLLDR to load the data into database with the format described as in the link
http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm
ie.'HH24:MI:SS'
Oracle does not support time-only values, it supports dates (with a time component).
You have a few options:
Store the value as a string, perhaps providing a leading zero for
the hour.
Store the value as the number of seconds (or minutes) past midnight.
Store the value as the time component of some arbitrarily defined date, for
example 0001-JAN-01 01:52:00 and 0001-Jan-01 14:45:00. Tell your report writers to ignore the date portion of the value.
Your source datatype will be string(8). Use LPAD to add leading zeroes.

Resources