Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
anderseriksson
Partner - Specialist
Partner - Specialist

How to Base64 decode a string in Sense?

Have the need to decode a Base64 string in Sense OnPremise, how can I do that?

Labels (1)
1 Solution

Accepted Solutions
anderseriksson
Partner - Specialist
Partner - Specialist
Author

Implemented my own Base64 decoding in Qlik Sense.
It is slow but it works for my case, got the data I needed decoded.

View solution in original post

9 Replies
vinieme12
Champion III
Champion III

Refer this article

https://community.qlik.com/t5/Official-Support-Articles/How-to-read-images-from-a-database-and-displ...

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
anderseriksson
Partner - Specialist
Partner - Specialist
Author

Thanks but I'm not loading an image to show in Sense, I'm loading data encoded in Base64 and need to decode that data!

vinieme12
Champion III
Champion III

refer page 6 of the below document   attached in the article

vinieme12_0-1665970432467.png

 

Document preview of Qlik Sense Image Loading From Database.pdf
 
Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
anderseriksson
Partner - Specialist
Partner - Specialist
Author

@vinieme12  as I said above I'm NOT loading an image!

anderseriksson
Partner - Specialist
Partner - Specialist
Author

Implemented my own Base64 decoding in Qlik Sense.
It is slow but it works for my case, got the data I needed decoded.

Huberto
Creator
Creator

Hi @anderseriksson,

Could you kindly share the solution you implemented for this problem?

Thanks in advance.

 

Regards,

Huberto Pereira Haideman

anderseriksson
Partner - Specialist
Partner - Specialist
Author

@Huberto just noticed your question and don't know if it is still valid (not had time for the forum for some while).
My solution was using Qlik Script to translate Base64 text but very slow and with increasing data it was no longer valid. Changed to a different solution involving things available in Windows.
Not the prettiest solution but it works for my case.

1) save the Base64 string to a text file: path\Base64.utf
2) that file is UTF encoded by Qlik but I need it to be ASCII for the Windows decoding!
Thus I run the Powershell command: Get-Content path\Base64.utf | Set-Content  path\Base64.txt -Encoding Ascii
3) to decode the Base64 Ascii file i run Windows command;
certutil -decode -f path\Base64.txt path\Decoded.csv
4) now I can use Decoded.csv in Qlik Sense like any other csv-file

Wanted to run these commands from inside Qlik Script with exec command but that would not work.
Instead I configured it as a Scheduled Windows Task to coincide with my Qlik Tasks.
Doing this at night I have no timing issues with the tasks as I can leave margins between.

Hope this helps.

Alan_Slaughter
Support
Support

Maybe this could help with the decoding:

https://www.base64decode.org/

Huberto
Creator
Creator

Thanks for taking the time to reply to my question, @anderseriksson.

Regards,

Huberto Pereira Haideman