This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// calculation of distance of two geo references (lat/lon): | |
= 12742 * atan2(sqrt(sqr(sin(((lat2-lat1)*PI()/180)/2)) | |
+ (cos(lat1*PI()/180) * cos(lat2*PI()/180)) | |
* pow(sin(((lon2-lon1)*PI()/180)/2),2)), | |
sqrt(1 - (sqr(sin(((lat2-lat1)*PI()/180)/2)) | |
+ (cos(lat1*PI()/180) * cos(lat2*PI()/180)) | |
* pow(sin(((lon2-lon1)*PI()/180)/2),2)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data: | |
LOAD * INLINE [ | |
Year, Product | |
2010, P1 | |
2011, P1 | |
2012, P1 | |
2010, P2 | |
2011, P2 | |
2011, P3 | |
2012, P3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dateFromQlikNumber(n) { | |
var d = new Date(Math.round((n - 25569) * 86400000)); | |
// since date was created in UTC shift it to the local timezone | |
d.setTime(d.getTime() + d.getTimezoneOffset() * 60000); | |
return d; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// matrix has numeric field names starting from "0" and a record number: | |
for i=0 to 34 | |
for j=0 to 34 | |
adj_list: | |
LOAD $(i) as node1, | |
$(j) as node2, | |
"$(j)" as measure | |
resident matrix | |
Where rec - 1= $(i) and "$(j)" > 0; | |
next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=Replace( | |
ColorMix2 (if(rangemin(.90,rangemax( Sum(value) / Max({1} TOTAL value),.50))<.75,-Sqrt(-(rangemin(.90,rangemax( Sum(value) / Max({1} TOTAL value),.50))-.75)/(.75-.50)),Sqrt((rangemin(.90,rangemax( Sum(value) / Max({1} TOTAL value),.50))-.75)/(.90-.75))), RGB(255, 0, 0), RGB(0, 255, 0), RGB(255, 255, 0)) | |
,'ARGB(255,','RGB(') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// calculates hue for temperature from -30 to +30 °C: | |
hsl((30 + 240 * (30 - max({<Etage={EG}>} Temp)) / 60) / 255, 0.75, 0.9) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @owner Ralf Becher, irregular.bi | |
*/ | |
define( ["jquery", "qlik"], | |
function ($, qlik) { | |
return { | |
//property panel | |
definition: { | |
type: "items", | |
component: "accordion", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajaxSetup({ | |
headers: { | |
"Authorization": 'Basic ' + window.btoa(username+":"+password) | |
} | |
}); | |
$.ajax(txUrl(), { | |
type: "POST", | |
data: JSON.stringify({ | |
statements: [{ | |
statement: query, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Formula to optain microseconds from TimeField: | |
LOAD ((frac(TimeField) * 86400000) - floor(frac(TimeField) * 86400000)) * 1000 as Micro | |
FROM ...; | |
//Use this formula for formatting: | |
LOAD Timestamp(TimeField - (Micro/86400000000)) & Num(floor(Micro), '000') as TimeStamp | |
FROM ...; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// thanks to Stefan Walther for giving a hint an this matter: https://github.com/stefanwalther | |
Qv.LoadExtensionScripts([_path + 'js/require.js'], | |
function () { | |
require([_path + 'js/d3.v3', _path + 'js/nv.d3.min', _path + 'js/interactiveLayer', _path + 'js/utils'], | |
function () { | |
Qv.AddExtension(_extension, | |
function () { | |
// render it.. |