Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Help!!
I have the sample data like below, I want to do a basket analysis, e.g. when I select an category on an list box(e.g. DL) the graph would show the associate category that is in the same session id, but without invoice id (in terms of no. of time of session)
Session ID | InvoiceID | ItemID | Category |
---|---|---|---|
3620 | 1 | 211 | DL |
3620 | 1 | 212 | DL |
3620 | 1 | 213 | DB |
3620 | 1 | 214 | DB |
3620 | 1 | 215 | W |
3620 | 216 | Q | |
3620 | 217 | Q | |
3620 | 218 | E | |
1111 | 2 | 219 | DL |
1111 | 2 | 220 | E |
1111 | 2 | 221 | JL |
1111 | 222 | JL | |
1111 | 223 | Q | |
1111 | 224 | W |
for example, when I select DL on a list box,The result should be below, how can I achieve below with what dimension and expression??? Many Thanks for help.
Category | No. of session |
---|---|
Q | 2 |
E | 1 |
W | 1 |
Sunny,
Because i want to know for each category, how many times it have not been sold with the selected category on the same session..in the sample data above, i assume that i would click category E( have been sold on the session) on a list box , and the chart shows that JL have have not been sold with category E in one session( 1111)....
i am able to find out the category that have been sold together with the selected category with the below expression with the use of invoice ID, however i cannot find those not sold together with the selected item......
=count(DISTINCT {$<InvoiceID=P({$}InvoiceID),Category=E({$}Category),Flag = {0}>}InvoiceID)
Tried many times, could you kindly help.
Not 100% sure, but try this
=Count(DISTINCT{<Category = p({<Category, [Session ID] = p([Session ID]), Flag = {1}>}), Flag = {1}, [Session ID] = p({<Flag = {0}>})>}[Session ID])
Thanks so much sunny, this is what i want to acheive.
you saved my day.
Super... I am glad you got what you wanted...
Best,
Sunny