Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

'Rolling average' in text & image

I'm trying to show an average of the last 30 days work of data. I can't get it to work in Text and Image.

In a table, here's what I have:

rangeavg(top([my_field], 1, 30)

This shows my data in the table OK and calculates the correct average.

But I don't want this in a table, I want it in a Text & Image box. But when I put the same expression in Text & Image, I get a null output. My guess is that this has something to do with sorting. Of course, the documentation is of no help whatsoever.

The only other way I can think of doing this is to use firstsortedvalue 30 times, but this seems to be an awful solution. I thought of using a set expression, but I can't for the life of me work out what the set expression would be.

My underlying data is in this form:

Date, my_field

Tags (1)
1 Solution

Accepted Solutions
ramoncova06
Valued Contributor III

Re: 'Rolling average' in text & image

most likely is because it has more than one value, that the table box is not working

you can do set analysis this way

avg({< Date= {">=$(=(today()-30))<=$(=(today()))"}>}SHIPPEDQTY)

1 Reply
ramoncova06
Valued Contributor III

Re: 'Rolling average' in text & image

most likely is because it has more than one value, that the table box is not working

you can do set analysis this way

avg({< Date= {">=$(=(today()-30))<=$(=(today()))"}>}SHIPPEDQTY)