Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
adbdkb
Creator
Creator

Using DATE TIME functions in Qlik Replicate to translate into date and time

I am trying to convert incoming data from DB2 as source into Kafka as Target.

The dates in DB2 are coming in as Numeric (8,0) in the Task when I select the tables

They are defined as numeric with values as YYYYMMDD or 99999999

adbdkb_0-1653592854120.png

I want to define the function mapping using one of the date time functions to translate the inputs coming in as 20220525 or 99999999 into valid date format.  I couldn't find an example of what the modifier should be if using these functions

adbdkb_1-1653593260870.png

 

Thank you

 

Labels (2)
21 Replies
adbdkb
Creator
Creator
Author

Sorry, I wasn't clear.  

As you said, if I test in UI, I get the correct result

adbdkb_0-1653953549621.png

 

But if I check the Kafka message, it is like this

"key2": "{\"CompanyCode\":\"NCO\",\"MasterId\":\"V8579314\"}",
 
it escapes the double quotes.  not sure if json parsers would consider this to be valid json.  
 
Thanks
Heinvandenheuvel
Specialist III
Specialist III

Ok. I see what you mean with the backslash.

It kinda makes sense considering that what you requested to be constructed will be enclosed in double-quotes. So how would a parser know that the double quote before say "CompanyCode" is NOT the end the value but part of the value - it is told this using the escape.

Best I know the 'normal' way to generate an additional key is not a structure but just a concatenation of values, possibly in fixed length increments (add X spaces and substring)  or with separator or just glued together:

* substr ( $COMPANY_CODE || '          ', 1, 10) || trim($MASTER_ID)
* $COMPANY_CODE || '~' || trim($MASTER_ID)
* $COMPANY_CODE || trim($MASTER_ID)
​

fwiw,

Hein.