Square Slider Switch
Browser previewA square-cornered track with an outlined icon and a rectangular slider. Qlik If() logic reads vSwitch to slide the handle from left to right and swap the track fill and icon colour between grey and purple. Click the preview to toggle between 0 and 1.
='data:image/svg+xml;utf8,' &
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 60" width="100%" height="100%" preserveAspectRatio="xMidYMid meet">' &
'<desc>' & Num(Now(1)*86400000,'0') & '</desc>' &
'<rect x="10" y="13" width="100" height="34" rx="5" fill="' & If($(vSwitch)=1,'%236b5084','%23e5e7e8') & '" stroke="%23cbd3d0" stroke-width="2">' &
'<animate attributeName="fill" from="' & If($(vSwitch)=1,'%23e5e7e8','%236b5084') & '" to="' & If($(vSwitch)=1,'%236b5084','%23e5e7e8') & '" dur="0.2s" fill="freeze"/>' &
'</rect>' &
'<rect x="16" y="19" width="21" height="22" rx="3" fill="none" stroke="' & If($(vSwitch)=1,'%23ede6f3','%23899591') & '" stroke-width="1.5"/>' &
'<path d="M21 30h11" stroke="' & If($(vSwitch)=1,'%23ede6f3','%23899591') & '" stroke-width="1.5"/>' &
'<rect x="' & If($(vSwitch)=1,'72','14') & '" y="17" width="32" height="26" rx="4" fill="%23ffffff" stroke="%23d1d8d5" stroke-width="1.5">' &
'<animate attributeName="x" from="' & If($(vSwitch)=1,'14','72') & '" to="' & If($(vSwitch)=1,'72','14') & '" dur="0.2s" fill="freeze"/>' &
'</rect>' &
'</svg>'Paste into a Qlik measure / variable — see the linked lesson’s setup steps.












