Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Need some help with a simple load problem.
I have a simple sales table , it has Account ID, Sales Channel, order ID and Order Date. (load script below)
It has two accounts and 4 orders for each accounts.
SALES:
load * inline
[ACC, CHNL, ORD_ID, PROD , DT
AC123, Web, ORD1, DVD, 1/1/2012
AC123, STORE, ORD2,CD, 1/1/2013
AC123, Phone,ORD3, BOOK, 1/1/2010
AC123, Web,ORD4,TSHIRT, 1/1/2011
AC980, Store,ORD5,BOOK, 2/1/2010
AC980, Phone,ORD6,TSHIRT, 2/1/2011
AC980, Web,ORD7,DVD, 2/1/2012
AC980, Web,ORD8,CD, 2/1/2013];
After loading this what I would like to extract the DISTINCT Account IDs and their fist order information and create a new table.(the blue records alone)
Can we use some kind of ranking ?
As example , from the above scanrio , it should create the following two records
Ex.
AC123, Phone,ORD3, BOOK, 1/1/2010
AC980, Store,ORD5,BOOK, 2/1/2010
Thanks in advance and truly appreciate your help..
Thanks,
Aji Paul.
You can use the firstsortedvalue function. See attached qvw.
Thanks Gysbert!
This is helpful!
BTW what I need is another table while loading. Is there any way we can do that?
Thanks,
Aji Paul
Gysbert,
What I ment was after loading I will have two tables 1. Sales 2. First Sales. What I would do is Drop the sales table after creating the second table.
So what I left with at the end of loading is the "First Sales" table.
Thanks,
Aji.