Skip to main content
Announcements
NEW Customer Portal: Initial launch will improve how you submit Support Cases. FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
EmpireDist
Contributor
Contributor

Last 3 sales dates by item per customer

I have a straight table with expression Customer, Txn Date, and Item. I want to display only the last 3 Txn Date per item per customer. 

9 Replies
Saravanan_Desingh

Try using Rank function. If you could not, please post a sample file with expected output

EmpireDist
Contributor
Contributor
Author

I need it to display only the last 3 sales transactions per customer per item.

EmpireDist
Contributor
Contributor
Author

I can not get a sample file to load

EmpireDist
Contributor
Contributor
Author

EmpireDist_0-1613605650975.png

 This is a sample report. I want to display only the last 3 sales transactions for each item per customer.

Saravanan_Desingh

Try this,

tab1:
LOAD F1, 
     F2, 
     Date, 
     F4, 
     Num, 
     F6, 
     Name, 
     F8, 
     Item, 
     F10, 
     Qty, 
     F12, 
     [U/M], 
     F14, 
     [Sales Price], 
     F16, 
     Amount, 
     F18, 
     [Loaded Cost]
FROM
[C:\Users\sarav\Downloads\6-6-3 PAT TEST.xlsx]
(ooxml, embedded labels, table is Sheet1);

Left Join(tab1)
LOAD Name, Item, Date, AutoNumber(Name&Item&Date) As Rank
Resident tab1
Order By Name, Item, Date Desc;
Saravanan_Desingh

You can use any Field in the place of Date here:

commQV04.PNG 

EmpireDist
Contributor
Contributor
Author

I still want it sorted the same way with the Customer first then sorted and grouped by item# and with the transaction dates descending. And show one column for the dates but only with the last 3 most recent dates for each transaction item per customer

EmpireDist
Contributor
Contributor
Author

I'm still waiting for assistance on this question. I don't think Rank will work because I still want the date to display in the same column but I only want it to display the last 3 transactions dates for each item and customer.

EmpireDist
Contributor
Contributor
Author

Do you have any more insight into this request? I need this to display only the last 3 TXNDATE per Item/Customer. I only want the date displayed in one column. I've been trying to get answers to this for way too long. I'm new to QLIK so a step by step answer would be helpful.

Community Browser