Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
qlikhalmar
Contributor

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

Re: Use base64_decode PHP function in Qlikview

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

Life is so rich, and we need to respect to the life !!!
qlikhalmar
Contributor

Re: Use base64_decode PHP function in Qlikview

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....

Re: Use base64_decode PHP function in Qlikview

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

Community Browser