Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
data_guru_001
Contributor III
Contributor III

Grouping by Unique Field

Hi,

I have a table & script as shown below:

ITEM     CLASS     AMOUNT

One       A               $10

Two       B               $20

Three    B               $16

Four      A               $8

TABLE:

ITEM,

CLASS,

Sum(AMOUNT) as AMOUNT

Resident

Data

Group by

ITEM,

CLASS;

What I want to do, is include a new field, NAME. Here is the table I am trying to recreate:

ITEM     CLASS     NAME     AMOUNT

One       A               Nick        $5

One       A               Jerry       $5

Two       B               Sarah      $20

Three    B               Alex         $10

Three    B               Carlos      $6

Four      A               Miguel      $8

My problem, however, is that when I use the below script the numbers are incorrect and are much higher than they should be. Like the above script/table, I just want to group by the ITEM & CLASS, not the NAME. Ultimately, my sum of amount, should not change at all.

Here is the script I am trying, but doesn't work...

TABLE:

ITEM,

CLASS,

NAME

Sum(AMOUNT) as AMOUNT

Resident

Data

Group by

ITEM,

CLASS,

NAME;

Is it possible for me to just group by the ITEM and CLASS like I did initially?

Thanks!

1 Reply
Lisa_P
Employee
Employee

Hi Data Guru,

I'm not sure why you are trying to aggregate this data.

If you load the table with NAME is it, this is the result in trying to see the data.

tables.PNG

Lisa