Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis formula datarange doesn't work

I would like to have the avg Stock Quantity of a daterange in set analysis. Daterange is between 60 days before reloaddate and 30 days before reloaddate. I've this formula but it's giving me the wrong result (result is - ). Can someone help. Thx!

=avg({$<Stockaging.StockDate={'>(=($(vReloadDate)-60)) <(=($(vReloadDate)-30))'}>} Stockaging.Redistributed)



4 Replies
Not applicable
Author

I think that when you reference to variables in set analysis it should be as $(#vReloadDate).

Regards,

Gordon

Not applicable
Author

Gordan, thanks for your reply. Unfortunately, your answer didn't work on my formula. Any other suggestions? Probably it's something small I misunderstand.

Thanks for helping.

Regards,

Koen

Not applicable
Author

... you also have some spurious bracketing between the conditional tests - think you need

>=($(vReloadDate)-60) <=($(vReloadDate)-30)

Not applicable
Author

The formula finally works with this:

avg({$<Stockaging.StockDate={'>=$(=Date($(vReloadDate)-60)) <=$(=Date($(vReloadDate)-30))'}>} Stockaging.Redistributed)

Thx for helping.

Br,

Koen