Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
RajeevaM061
Contributor II
Contributor II

Count Distinct on the dimension and the stamp the count on the lowest order number

Need your help to Count distinct values on the dim “ Package Pattern” w.r.t each invoice number and stamp the number based on the lowest order number in the sheet.

 

For Example :  For the Invoice “ 1111”, I have 1 distinct package pattern and need to stamp the count on the lowest order number in the table  . In the below  example, it’s 3rd row since 5 is lowest order number for the specific invoice.

 

Sales Invoice No

Order Number

Package Pattern

1111

10

Part A, Part B, Part C

1111

25

Part A, Part B, Part C

1111

5

Part A, Part B, Part C

1111

30

Part A, Part B, Part C

 

Expected result :

 

Sales Invoice No

Order Number

Package Pattern

Sequence Qty

1111

10

Part A, Part B, Part C

0

1111

25

Part A, Part B, Part C

0

1111

5

Part A, Part B, Part C

1

1111

30

Part A, Part B, Part C

0

 

Thank you !

1 Solution

Accepted Solutions
Digvijay_Singh

Something like this may be - 

Expression used is - 

Coalesce(Aggr(Count({<[Order Number]={$(=Min([Order Number]))}>}1),[Sales Invoice No],[Order Number]),0)

Digvijay_Singh_0-1634267445260.png

Thanks,

View solution in original post

2 Replies
Digvijay_Singh

Something like this may be - 

Expression used is - 

Coalesce(Aggr(Count({<[Order Number]={$(=Min([Order Number]))}>}1),[Sales Invoice No],[Order Number]),0)

Digvijay_Singh_0-1634267445260.png

Thanks,

RajeevaM061
Contributor II
Contributor II
Author

Thank you so much ! .. it's working