Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying to generate an SVG file in Qlikview, however I get a problem when I output the file to the .svg
I have the following script in Qlik, I am using a preceding load to add double quotes around the necessary text
In the Qlikview file it's correct, but when it outputs to the SVG file I have quotes around my quotes like below
How can I remove the Quotes so that I end up with the following
Can't be done with Qlikview script afaik. You could store the output in a .svg file and then process that file to remove the extra quotes with for example powershell script command:
cat .\WaffleChart.svg | % { $_ -replace """""", "@@" } | % {$_ -replace """", "" } | % {$_ -replace "@@", """"}
Using sed or a python script are some other options.
You could also try using a macro
see attached
hope this helps
I have never used powerscript before.
could I execute a .bat file from Qlikview to run powerscript and remove the Quotes?
Thanks Frank, this works perfectly
Hi Gysbert,
Do you mean PowerShell command?
Regards
Alan
uh yeah, that.
Hi Gysbert,
So I got it working with the following Powershell script to remove unwanted Quotes
Set-ExecutionPolicy Unrestricted
(Get-content .\WaffleChart.svg) | ForEach-Object{$_ -replace "`"`"", "`""} | ForEach-Object{$_ -replace "`"<", "`<" } | ForEach-Object{$_ -replace ">`"", ">" } | Set-content .\WaffleChart.svg
And I managed to EXECUTE from Qlikview script - needed to make a few changes in
User Preferences>>Secuirty etc..
But I got it working with the following Qlikview Script.
LET title = 'WaffleChart';
SVG:
LOAD * INLINE [
<!--svg-->
<svg width="800" height="800" fill="grey" xmlns="http://www.w3.org/2000/svg">
<Title>"$(title)"</Title>
<g>
];
LET y = 5;
LET x = 15;
LET width = 15;
LET height = 15;
LET strokewidth = 1;
LET stroke = '#ff0000';
LET fill = 'white';
LET id = 1;
for j = 1 to 10
FOR i = 1 to 10
concatenate(SVG)
LOAD * INLINE [
<!--svg-->
<rect id="$(id)" height="$(height)" width="$(width)" y="$(y)" x="$(x)" stroke-width="$(strokewidth)" stroke="$(stroke)" fill="$(fill)"/>
];
LET x = $(x) + $(width);
LET id = $(id) + 1;
NEXT i
LET y = $(y) + $(height);
LET x = $(width);
NEXT j
concatenate(SVG)
LOAD * INLINE [
<!--svg-->
</g>
</svg>
];
STORE SVG INTO .\WaffleChart.svg (txt);
//Ensure Security Settings are all ticked in User Preferences
LET ps = 'C:\Users\Alan.PRINCIPAL\Desktop\SVG\wafflechart.ps1';
EXECUTE powershell.exe $(ps);