Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

Not applicable

Basket Analysis - Condition on current selected field.

Help Again.

I have the following sample data:

Session IDInvoiceIDItemIDCategoryFlagsession_start
11112219E02017-01-01 11:30:30
11112220DL02017-01-01 11:30:31
11112221JL02017-01-01 11:30:32
1111222JL12017-01-01 11:30:33
1111223Q12017-01-01 11:30:34
1111224W12017-01-01 11:30:35
2222213DB12017-01-01 11:30:30
2222211DL12017-01-01 11:30:31
2222212DL12017-01-01 11:30:32
2222219DE12017-01-01 11:30:33
2222220E12017-01-01 11:30:34
2222221JL12017-01-01 11:30:35
2222222JL12017-01-01 11:30:36
3333213DB12017-01-01 11:30:31
3333211DE12017-01-01 11:30:32
3333212DL12017-01-01 11:30:33
3333219DL12017-01-01 11:30:34
3333220E12017-01-01 11:30:35
3333221JL12017-01-01 11:30:36
3620218E12017-01-01 11:30:30
36201213DB02017-01-01 11:30:31
36201214DB02017-01-01 11:30:32
36201211DL02017-01-01 11:30:33
36201212DL02017-01-01 11:30:34
3620216Q12017-01-01 11:30:35
3620217Q12017-01-01 11:30:36
36201215W02017-01-01 11:30:37
44441213DB02017-01-01 11:30:30
4444218W12017-01-01 11:30:31

i have a test QlikView file (see attached) that when selected a Category on the List box, the bar chart shows the no. of time each category have been on the same session id of the selected category, but have not sold at that session id.

E.g., when i select Q, Q have been on session 1111 and 3620, on both session, Q have not been sold, so we count 1 when a category is sold at a session.    

2.jpeg

I would like to achieve the following, e.g.

When i select E, it filters out those sessions with E have the min(session_start) for the session ID, with the above data, it would filter out session 1111, and 3620,...then only at session 3620, E have not been sold, then it counts 1 for each category that is sold at the session, the result should be below when select E.

CategoryNo. of session
DB1
DL1
W1

I am Newbie to QlikView scripting, can somebody help..

3 Replies
laddu_927
Valued Contributor

Re: Basket Analysis - Condition on current selected field.

What is the field showing whether an item is sold??

Not applicable

Re: Basket Analysis - Condition on current selected field.

Thanks for your reply Shiva, the presence of invoiceID indicates the item have been sold.

Not applicable

Re: Basket Analysis - Condition on current selected field.

or with flag with value 0 indicates the item has been sold.

Community Browser