Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
karan_kn
Creator II
Creator II

Allocating the Product by ID

Can someone help me how to allocate the product by ID. Please refer screenshot below for example.

LOAD * INLINE [

    ID, Product

    1, AAA

    1, BBB

    2, AAA

    3, AAA

    3, BBB

    3, CCC

    3, DDD

    3, EEE

    4, CCC

    5, DDD

    5, GGG

    5, HHH

];

Capture.PNG

1 Solution

Accepted Solutions
sunny_talwar

Like this

Table:

LOAD * INLINE [

    ID, Product

    1, AAA

    1, BBB

    2, AAA

    3, AAA

    3, BBB

    3, CCC

    3, DDD

    3, EEE

    4, CCC

    5, DDD

    5, GGG

    5, HHH

];


Left Join (Table)

LOAD ID,

1/Count(Product) as NewField

Resident Table

Group By ID;

View solution in original post

4 Replies
sunny_talwar

May be this

Dimensions

ID

Product

Expression

1/Count(TOTAL <ID> Product)

sunny_talwar

Sample and image attached

Capture.PNG

karan_kn
Creator II
Creator II
Author

Thanks sunny working well, one morething, how can we add this script (1/Count(TOTAL <ID> Product)) in Load script?

sunny_talwar

Like this

Table:

LOAD * INLINE [

    ID, Product

    1, AAA

    1, BBB

    2, AAA

    3, AAA

    3, BBB

    3, CCC

    3, DDD

    3, EEE

    4, CCC

    5, DDD

    5, GGG

    5, HHH

];


Left Join (Table)

LOAD ID,

1/Count(Product) as NewField

Resident Table

Group By ID;