# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Valued Contributor II

## How to compute Sales By Group Amount only for Top 3 customer ?

Hi

My Table 1 Expression display whole of last sales is correct :-

Money(

Sum({\$<year = {\$(=Max(year)-1)}, month = {"<=\$(=Max({<year={\$(=Max(year))}, sales = >} month))"}>}\$(ColumnDim51)/\$(Columndim89)/1000)

,\$(vMoneyFormatK))

On the next column , i need to display only Top 3 customer sales amount , so i use the expression given by sunny as below :-

Sum(TOTAL {<\$(ColumnDim101) = {"=Rank(Sum(sales)) < 4"}>}sales)

it return All  10,644,1876 which is wrong value.

Correct value is :-

G1 = 2.673 Billion

G2 = 0.718 Billion

Paul Yeo

5 Replies
Valued Contributor II

My QVW

MVP

## Re: How to compute Sales By Group Amount only for Top 3 customer ?

What is you use..

=Sum({<\$(ColumnDim101) = {"=Rank(Sum(sales)) < 4"}>}sales)

Valued Contributor II

## Re: How to compute Sales By Group Amount only for Top 3 customer ?

Hi Sir

The return number wrong, it should not be so much .

MVP

## Re: How to compute Sales By Group Amount only for Top 3 customer ?

How the correct value is

Correct value is :-

G1 = 2.673 Billion

G2 = 0.718 Billion

Can you provide example of above?

Valued Contributor II

## Re: How to compute Sales By Group Amount only for Top 3 customer ?

Hi Sir

When you Click on G1 Button , it will show the top 3 customer sales for G1 , when you add up the 3 row total it will be the total i need.

Paul