# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for
Did you mean:
Contributor III

## Linest_M and totals in a table

Hi,

possibly the wrong forum, but seemed most appropriate:

currently have a table calculating the linest_m value for the last 12 weeks  for a dimension selected via an island table, unfortunately having some trouble getting the Totals on the measure to reflect the linest_m of the data as a whole.

current expression is:

-LinEst_M({<WeekDiff={"<12"}>} aggr(sum({<WeekDiff={"<12"}>}ROWCOUNT),WeekDiff,[\$(=DimIsland)]),WeekDiff)

this works at a row level for all dimensions however the totals dont work how id want.

ideally I'd want it to equal the below no matter what dimension it is split to

-LinEst_M({<WeekDiff={"<12"}>} aggr(sum({<WeekDiff={"<12"}>}ROWCOUNT),WeekDiff),WeekDiff)

If i change the totals function to sum rather than auto it is accurate for some dimensions (dimensions that are always there) but not for others (i think this is because for some dimensions there might not be a complete 12 week picture so the slope is being calculated over a smaller period - eg a staff member that started 8 weeks ago).

WeekDiff an integer counting down to zero ie 3 is 3 weeks ago, 0 is this week , hence the - at the start of the expressions

DimIsland is a field in an island table with the selectable Dimensions in.

Realise what i want might not be possible and i have currently got some KPI objects doing the totals but would be nice to incorporate into the table if at all possible.

If anyone has any ideas that would be great

1 Solution

Accepted Solutions
Specialist II

Hi,

Following this thread Solved: Can we use a custom function to display a total in... - Qlik Community - 28825 could you use different formulae for total and body?

Cheers,

Chris.

2 Replies
Specialist II

Hi,

Following this thread Solved: Can we use a custom function to display a total in... - Qlik Community - 28825 could you use different formulae for total and body?

Cheers,

Chris.

Contributor III
Author

Perfect, thanks for that seems to work exactly as needed, will share this as a workaround (hopefully custom total calculations will come at some point)

Very much appreciated 🙂

Tags
Community Browser