Skip to content

Instantly share code, notes, and snippets.

View ralfbecher's full-sized avatar

Ralf Becher ralfbecher

View GitHub Profile
@ralfbecher
ralfbecher / QlikView_Load_Inline_Data_with_alternate_Delimiter.qvw
Created December 11, 2013 10:10
QlikView Load Inline Data with alternate Delimiter (eg. Pipe). This enables a possibility to copy/paste data from a deviate formatted CSV source without replacing the delimiters manually to comma..
INLINE:
Load * Inline
[
ENAME|SAL
SCOTT|800
SMITH|900
KIND|600
]
(ansi, txt, delimiter is '|', embedded labels)
;
@ralfbecher
ralfbecher / wblGen.bat
Last active September 7, 2016 10:04 — forked from nate-untiedt/wblGen.bat
A simple batch file that automatically generates the wblfolder.wbl for your Qlik Sense visualization extension.
@echo off
REM wblGen.bat - v 1.0.0 - 2015-10-09
REM Description:
REM A simple batch file that automatically generates the wblfolder.wbl for your Qlik Sense visualization extension.
REM
REM Author: Nate Untiedt - Analytics8 - nuntiedt@analytics8.com
REM
REM Credit to: http://stackoverflow.com/a/8387078
setlocal EnableDelayedExpansion
@ralfbecher
ralfbecher / qlikNumberFromDate.js
Created May 16, 2016 15:47
JavaScript function to get QlikView or Qlik Sense numerical Date value from JavaScript Date
function qlikNumberFromDate(d) {
return d.getTime() / 86400000 + 25569;
}
@ralfbecher
ralfbecher / Qlik_Subtract_DST.qvs
Last active January 19, 2017 15:42
Qlik Subtract DST
//subtract hour from timestamp when DST
=TimeStamp(field - frac(ConvertToLocalTime(field,'Berlin') - frac(field)) + 1/24)
@ralfbecher
ralfbecher / QlikView_Show_non-selected_Values.qvs
Created September 10, 2013 09:06
Show non-selected values in a listbox.
// This expressions gives all non-selected values
=aggr(only({1-$} Field), Field)
@ralfbecher
ralfbecher / QlikView_Patch_ARGB_to_RGB.qvs
Last active January 25, 2017 16:17
QlikView ColorMix function cannot be used in SVG extension color expression because it returns ARGB(), alpha is not usable for SVG path (use opacity property instead). This shows how to patch the return to RGB() code if alpha is a constant value.
// patch ARGB() to RGB():
=replace( ColorMix1( ... ) , 'ARGB(255,', 'RGB(' )
@ralfbecher
ralfbecher / QlikView_Read_SheetIDs.qvs
Last active January 25, 2017 16:17
Read sheet ID and name of a QlikView document
Set vDocument=C:\Projekte\QlikView\MeineApp.qvw;
Sheets:
LOAD '$(vDocument)' as DocumentName,
SubField(SheetId, '\', 2) as SheetID,
Title as SheetName
FROM [$(vDocument)] (XmlSimple, Table is [DocumentSummary/Sheet]);
@ralfbecher
ralfbecher / QlikView_Load_broken_CSV.qvs
Created September 11, 2013 21:42
Load data from text or CSV file with broken format where a field contains CR/LF.
/* Example file 'broken.txt' with a broken line, field containing CR/LF:
Field1|Fiel2|Field3
Abcd|efg|hijk
Lm|no
pq|vwz
123|456|7890
*/
Set vDelimiter = '|';
Set vNoOfColumns = 3;
@ralfbecher
ralfbecher / QlikView_Wrap_Conditional_View_Expression.qvs
Last active January 25, 2017 16:17
In QlikView conditional show expressions cannot handle NULL values. The object will be visible because NULL is treated as TRUE (or the expression doesn't evaluate right).
// In this case it is helpful to wrap the expression to catch NULL and empty string:
// works for:
// =if(Null(), -1, 0)
// =if('', -1, 0)
=if(<expression>, -1, 0)
@ralfbecher
ralfbecher / QlikView_more_than_14_digits.qvs
Created September 13, 2013 13:09
Loading numbers in QlikView with more than 14 digits leads into scientific (exponential) notation. The 64-bit IEEE float can only show 14 digits.
LOAD Div(Field, 1e10) & left(repeat('0',10), 10 - len(text(Mod(Field, 1e10)))) & Mod(Field, 1e10) as MyNum