Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sliding change

Hello There,

In the table below I'm looking for an expression that is able to determine the sliding change per every 5 minutes. In other words, I'm looking for an expression that would show the difference between the value of 'Measure' at 5 mins and 1 min (i.e. difference between 594.00 and 433.36), at 10 mins and 5 mins (i.e. difference between 589.49 and 594.00), at 15 mins and 10 mins (i.e. difference between 579.36 and 589.49) etc, etc. Any ideas please?

Untitled.png

6 Replies
marcus_sommer

You could use Peek() or Previous() ? for this. If your time-line is really continuous you could use something like this:

...

if(mod(minute(Time), 5) = 0, Measure - peek('Measure', -4), 'else value') as MeasuresDiff

...

If not it will be need more efforts to determine the if-checks to find the right previous record.

- Marcus

Not applicable
Author

Thanks Marcus,

It appears the functions Peek() or Previous() does not exist on my list of functions. Is this to do with version?

marcus_sommer

You mean list of functions - they aren't fields. And they are included in each version. The versions have no differences within the functionalities only in the right to share an application or not.

- Marcus

Not applicable
Author

Yes correct, functions!

So in this case do you have any idea why can I not see these two functions? Very strange!

Untitled.png

marcus_sommer

Peek and previous are script-functions and aren't available within the gui. Have you looked into the document which I mentioned above?

- Marcus

spividori
Specialist
Specialist

Hi.

See the atached example. It is referred to Marcus.

Regards.