Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Christiann
Partner - Contributor III
Partner - Contributor III

SQL-Statemen '... OVER ( PARTITION BY ... RANGE BETWEEN INTERVAL ... ) AS ... in Qlik Sense

Hi,

 

I've a small challenge with translating from a SQL statement in Qlik Sense syntax

In SQL I can create a field over a range during the reading of the data like this:

 

SELECT

       TIME_STAMP,

       MEASURE_NAME,

       MEASURE_VALUE,

       min( MEASURE_VALUE ) OVER ( PARTITION BY MEASURE_NAME

                 RANGE BETWEEN INTERVAL '1' HOUR PRECEDING AND CURRENT ROW ) ) AS MIN_MEASURE_VALUE

FROM MyTable

ORDER BY TIME_STAMP;

 

So I create a new field with the minimum value of the last hour for every line (the TIME_STAMP is a value in second).

A solution in the script would be advantageous, because over this min value in another same procedure the average value over one day and from this the average value over the last 10 days is to be formed.

But also every other tip is welcome.

Thanks

 

Christian

Labels (1)
0 Replies