Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

BojiRigger
New Contributor

How to Aggr a RangeSum Command

I am attempting to create an expression using RangeSum command and aggr.   

I am trying to create a running % of sales by a line grouping.

The row is by Product with the Product Grouped in a higher level grouping call prodcat

In other words, I want to see the % of sales by product X the prodcat

When I enter the following, all works well.  

=(Rangesum(Above(Sum(line_total),0,RowNo(TOTAL))))/Sum(TOTAL line_total)

When I attempt to aggr by prodcat, I get sporadic results, only one row in the grouping returns a %.

=(Rangesum(Above(Sum(line_total),0,RowNo(TOTAL))))/aggr(Sum(TOTAL line_total),prodcat)

I am new to Qlikview so be gentle???  LOL

 

 

 

Labels (1)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: How to Aggr a RangeSum Command

Your approach missed an outer aggregation - in this way it's rather a calculated dimension. Therefore try it in this way:

avg(aggr(Sum(TOTAL line_total),prodcat))
   or maybe with
aggr(NODISTINCT Sum(TOTAL line_total),prodcat)

- Marcus

View solution in original post

2 Replies
MVP & Luminary
MVP & Luminary

Re: How to Aggr a RangeSum Command

Your approach missed an outer aggregation - in this way it's rather a calculated dimension. Therefore try it in this way:

avg(aggr(Sum(TOTAL line_total),prodcat))
   or maybe with
aggr(NODISTINCT Sum(TOTAL line_total),prodcat)

- Marcus

View solution in original post

BojiRigger
New Contributor

Re: How to Aggr a RangeSum Command

Marcus, 

 

Thank you so much.  Changing divisor to   aggr(NODISTINCT Sum(TOTAL line_total),prodcat) worked perfectly.

Really appreciate the advice!

Thanks,

 

Randy