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: 
dmac1971
Creator III
Creator III

% Purchased

Is it possible for me to count the number of items purchased from Parts List A from 2013 sales?  Or alternately show a full list of the items on Parts List A and a total of the sales for the year?

7 Replies
Not applicable

Definitely. But you gotta give us more info than that! Do you have a sample file?

DavidFoster1
Specialist
Specialist

You need to give us a bit more than that...

Can you show us your data model?

Not applicable

You'll have to replace the dummy fields for your own but for the count use a formula such as;

count( {< Year = {'2013'}, Partlist = {'A'} >} items)

Alternatively, to show the total sales for Parts List A, use a Straight or Pivot table with Items in your dimensions and use the expression;


sum( {< Year = {'2013'}, Partlist = {'A'} >} SalesValue)

You could remove the Year from the above formula and add that into your dimensions.  You could also change the year to run off a variable which defaults to the current year.

But as mentioned above, without further information it is difficult to guide you.

Regards


Steve

dmac1971
Creator III
Creator III
Author

Ok Lets say I have a list of items I want my shops to carry:

[Rec Sales]

Item NoDescRec Qty
1234Mug5
1235Plate5
1000Knife10
1001Spoon20
1002Knife10

And I have their Sales Data :

[Actual Sales]

ShopItem NoDesc# Purchased
A1234Mug15
B1000Knife3
C1234Mug12
D1001Spoon4
E1000Knife10

Now I want to do two things, I want to show [Rec Sales] with a total showing actual sales at the end against recommended sales, and then I want to show the actual % of items from the recommended list actually purchased?  Hope this makes it clearer?

DavidFoster1
Specialist
Specialist

This is effectively a sales versus target issue.

The expression:

sum(# Purchased) / sum(Rec Qty) would give you the proportion of actual sales to recommended sales.

dmac1971
Creator III
Creator III
Author

Sorry this is what I am aiming for below :

Item NoDescReq QtyAct Qty
1234Mug527
1235Plate5
1000Knife1013
1001Spoon204
1002Knife10
So 60% of
  Rec Items Purchased
However only
  20% actually Purchased the right amount
DavidFoster1
Specialist
Specialist

🙂 d'oh I got the wrong end of that stick :-).

I would do this in the load script left joining the sales to the recommendation script and loading a 1 or 0 in a field called something like 'isrecommmended' and then use a preceding load to compare the sales quantity to the recommended quantity and returning a 1 or 0 in a 'matches recommendation' field. Then the front-end work is a sum of those flag fields compared to the count of all transactions.