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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikhalmar
Creator
Creator

Use base64_decode PHP function in Qlikview

Hello all,

I need to decode a field in mij databasetable. It is filled with a value like:

YTo1OntzOjU6Iml0ZW1zIjthOjE6e2k6MDthOjE3OntzOjY6Iml0ZW1JZCI7czozOiI0NjkiO3M6NToiY291bnQiO2k6MTtzOjc6Im9wdGlvbnMiO2E6MDp7fXM6NDoiaGFzaCI7czoxNToibHJzcHlvNDl6WlZEVFVhIjtzOjk6Im9wbWVya2luZyI7czoxMDI6IlppZSBlbWFpbCB2YW4gamVudGVkZWpvbmdAZ21haWwuY29tIHZlcnN0dXVyZCBvcCAxMiBhcHJpbC4gbWVwdGFhcnQgYmlqcGFzc2VuZCBiaWogZ2Vib29ydGVrYWFydHRhYXJ0LiI7czo4OiJsZWVmdGlqZCI7YjowO3M6NDoiZmlsZSI7YjowO3M6NDoidHlwZSI7czo1OiJ0YWFydCI7czo0OiJuYW1lIjtzOjIwOiJNZXAtIGVuIFBsZXQgVGFhcnRqZSI7czoxMToicHJvZHVjdENvZGUiO3M6NzoiTWVwLTAwMiI7czo3OiJmaWxlVXJsIjtiOjA7czo1OiJwcmljZSI7czo1OiIxMi45NSI7czo2OiJ0YXhMb3ciO3M6NDoiMC43MyI7czo3OiJ0YXhIaWdoIjtzOjQ6IjAuMDAiO3M6MTA6InRvdGFsUHJpY2UiO3M6NToiMTIuOTUiO3M6MTE6InRvdGFsVGF4TG93IjtzOjQ6IjAuNzMiO3M6MTI6InRvdGFsVGF4SGlnaCI7czo0OiIwLjAwIjt9fXM6MTA6InRvdGFsUHJpY2UiO3M6NToiMTIuOTUiO3M6NDoidHlwZSI7czo1OiJ0YWFydCI7czoxMToidG90YWxUYXhMb3ciO3M6NDoiMC43MyI7czoxMjoidG90YWxUYXhIaWdoIjtzOjQ6IjAuMDAiO30=

In PHP you can use the function unserialize(base64_decode("<tekst>")).

Can anyone help me to do this in QlikView/Qlik Sense?

Thanks!

Halmar

3 Replies
Anil_Babu_Samineni

This binary size is long. This will run as False. Or would you describe more with output

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
qlikhalmar
Creator
Creator
Author

The first step is to decode the string.

I found out that you can do that with SQL:

FROM_BASE64(<field>) AS Field

But, the array that you get is a different story....

Peter_Cammaert
Partner - Champion III
Partner - Champion III

You cannot use PHP script code in a QlikView document without spending a lot of time and energy trying to glue the pieces together. But you can decode a Base64 encoded field value using a comparable VBScript macro that is called in your LOAD script.

See the first function (appropriately called "Base64Decode") in Re: How to generate xuser &amp; xpassword in txt file

Best,

Peter