Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

explination?

fabs(avg({<productdate={'>$(=date($(vmaxperiod)-$(vdaysfortrending)<=$(=date($(vmaxperiod)))'}sales/1000))

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

fabs(avg({<productdate={'>$(=date($(vmaxperiod)-$(vdaysfortrending)<=$(=date($(vmaxperiod)))'}sales/1000))

Here >$(=date($(vmaxperiod)-$(vdaysfortrending) it will give maxperod - no.of days for trending is greaterthan

and )<=$(=date($(vmaxperiod) less than of maxperiod of average of sales it should be in positive.

using fabs it vl convert negative value to positive

View solution in original post

4 Replies
miikkaqlick
Partner - Creator II
Partner - Creator II

Hi!

This returns absolute value for average of sales over certain period. Divided by 1000.

Br,

Miikka

Climber

JonnyPoole
Former Employee
Former Employee

For the date range in the user's selection,  return the average sales for the previous number of days where the number of previous days is equal to the variable:  vdaysfortrending.

The averages will be  divided by 1000 , and any negative number will be rendered as an absolute value (fabs())

Not applicable
Author

Hi,

fabs(avg({<productdate={'>$(=date($(vmaxperiod)-$(vdaysfortrending)<=$(=date($(vmaxperiod)))'}sales/1000))

Here >$(=date($(vmaxperiod)-$(vdaysfortrending) it will give maxperod - no.of days for trending is greaterthan

and )<=$(=date($(vmaxperiod) less than of maxperiod of average of sales it should be in positive.

using fabs it vl convert negative value to positive

Not applicable
Author

If you got it just mark it as correct answer and close the thread