Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Question about aggregation

I have a chart with two dimensions, Item Number and Batch Number. It also has 3 expressions: sum(WI_TotalUnits), sum([Physical stock]), and the 3rd expression is a conditional statement intended to count the number of lines on which there is no variance between WI_TotalUnits and Physical stock, like so:

if (sum([Physical stock]) - sum(WI_TotalUnits) <> 0,0,1)

I then use the Avg function (instead of Expression Default) to convert to the percentage of rows that have no variance.

However my problem comes in when I want to do the same percentage calculation in a TEXT BOX, rather than in the totals row of my chart. I need to place the entire logic into an independent text box to get the same percentile result. I have been looking at the AGGR() function but this is giving me the wrong answer. This is what I have so far:

sum(

    aggr(

        if(sum(WI_TotalUnits - [Physical stock]) <> 0,0,1)

        ,[Item number], [Batch number]

        )

    )

This aggregate gives a percentage result that is different to the one in the original chart. What am I doing wrong?

Thanks!

1 Reply
Highlighted
Not applicable

Re: Question about aggregation

Not to worry I think I've sorted this out.