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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
kamielrajaram
Creator III
Creator III

Before function


Good day all,

I am using the before function and it works fine, the problem is that I need a value in the total column. I have 2 dimensions, groups and weeks. the final value for each group needs to be added to give me a total value. Any help would be appreciated.

Regards

Kamiel

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hi Kamielrajaram,

I am not sure if I got your request properly, but I think you could get what you want if you combine dimnesionality() to check if your on total line, bottom() to get the last line and advanced aggregation to rebuild the table on total line virtually, maby like

=if(secondarydimensionality()=0,sum(aggr(aggr( bottom(sum(Value),2),Group,Article),Group)),before(sum(Value)))

The exact expression will depend on the orientation of your pivot dimensions, so I added two examples with dimensions in horizontal or vertical orientation.

Hope this helps,

Stefan

View solution in original post

1 Reply
swuehl
MVP
MVP

Hi Kamielrajaram,

I am not sure if I got your request properly, but I think you could get what you want if you combine dimnesionality() to check if your on total line, bottom() to get the last line and advanced aggregation to rebuild the table on total line virtually, maby like

=if(secondarydimensionality()=0,sum(aggr(aggr( bottom(sum(Value),2),Group,Article),Group)),before(sum(Value)))

The exact expression will depend on the orientation of your pivot dimensions, so I added two examples with dimensions in horizontal or vertical orientation.

Hope this helps,

Stefan