Hello,
I have a datasetr with the following columns:
ordernumber, item number,picked date.
I want to calculate how many times 2 or 3 items are sold togheter in the same ordernumber.
this could help to understand the sinergy among items.
While I could do this easily in python, I need to do the same calulation in QS since it will be nice to have the filter on the picked date.
In python I can filter the date, do the calculations and upload the df in QS and show that.
if I understand your problem, my suggestion is utilise a formula to tally the number of items associated with each ordernumber. For instance, you might employ the following expression: countOver({item number}, [{ordernumber}], PRE_AGG). This will generate a field that enumerates the items linked to each ordernumber
add 3 columns âitem Number 1â = itemNumber1 , âitem Number 2â=âŚ
add a filter: âitem numberâ = itemNumber1 or âitem Number 1â=NotSelected OR âitem numberâ = itemNumber2 or âitem Number 2â=NotSelected OR âitem numberâ = itemNumber3 or âitem Number 3â=NotSelected
add filter AllItemsAreUsedTogather=1
The main idea: when you set item numbers for 2 parameters we show only orders where bot of them were found.
Itâs not an ideal solution, just an idea, you should come up with a tradeoff between usability and simplicity.
I believe you can implement it using a Pivot visual (with aggregating turned on) using Order in a Group By section, Item Name or Item Code as a column name and a column with hardcoded 1 as a value. You also will have to use window function distinctCountOver() (as far as I remember they are in the section Table Functions in QuickSight) instead of distinct_count(). It should be something like this: distinctCountOver(itemNumber, [orderNumber], PRE_AGG).
There are many ways to implement this, just chose the one that gives you better result/efforts rate
Hi @remba87,
Since we have not heard back, Iâll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.