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

Chart Expression Challenge

Hi All,

I received a request to analyze rejects per order for quality control purposes. To keep it simple, I have two columns in a table that shows by order how many rejects were noted:

ORDER_CDETYPE_CODE
101Q1
101K1
101K2
101K3
101R1
102Q2
102K4
102K5
102K6
103R2
103Q3
103K9
103K10
103K11
103R15
103R16

My challenge is to report for every order code  that has a Q type code,  which K codes and how many need to be reported.

The layout would look like this.  In other words they want to see for every Q reject in an order, how many K rejects are there.  Note: there can be many other rejects lik R1, R2 so this can get complicated.  I tried set analysis but couldn't get it to work. I imagine if you have two sets: orders with Q and orders with K you can get some type of intersection. I need to exclude the other type codes other than K.

Q CodeK Code Count
Q1K11
Q1K21
Q1K31
Q2K41
Q2K51
Q2K61
Q3K91
Q3K101
Q3K111

Not sure how to solve this.  Does anyone have a solution?  Thanks.

Don

1 Solution

Accepted Solutions
Not applicable
Author

Maybe there is a better way, but It's working.

I just added 102,K4 to check the count.

Let me know if it's not that you expect.

View solution in original post

4 Replies
Not applicable
Author

Could you give an example where the count is <>1

do we use ORDER_CDE like a key?

I'm not sure to understand

Not applicable
Author

Thank you Eva.  Yes ORDER_CDE and TYPE_CDE are both keys.  I basically want to count the number of orders with a Q TYPE_CDE that also have a K TYPE_CDE.  Keep in mind that there can be other TYPE_CDE s other than Q or K. Hope this helps.  Please let me know if you need more.

Not applicable
Author

Maybe there is a better way, but It's working.

I just added 102,K4 to check the count.

Let me know if it's not that you expect.

Not applicable
Author

Eva, thank you so much for looking into this.  I tried to use a calculated dimensions for Type_Code = Q and Type_Code = K, but it didn't work.  It looks like I will have to do this in the load script like you did.