Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Showing Min + Max dates from an order date dimension

Hi there, I was hoping someone would be able to help me, I'm fairly new to QV and don't have any coding experience and I have hit a problem with a straight table that may be pretty basic;

I have a chart and currently the I am showing all of the orders associate with the Visitor_ID no for example

Visitor_ID
Order_Date
23215601/01/2009
23215605/05/2010
23215609/12/2011
23215612/12/2012
12359402/03/2010

What I need to show is this

Visitor_IDFirst_Order_Date
Last_Order_Date
23215601/01/200912/12/2012
12359402/03/201002/03/2010

Is there anyway I can do this in a Chart using either an edited Dimension or an expression?

many thanks for your help

Nicola

1 Solution

Accepted Solutions
Not applicable
Author

Thanks very much Gabriel, work great.

regards


Nicola

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi!

Take a look on the attached file. I think that is what you looking for.

Regards,

Gabriel

Not applicable
Author

Hi Gabriel, thanks for the quick reply,

I only however have one field containing a date not two, I wanted to split out the first date associated with a customer and that last one.

regards

Nicola

Anonymous
Not applicable
Author

Hello Nicola.

Take a look on the script of the qvw that I've attached before.

I've created an excel file with this structure:

Visitor_ID
Order_Date
23215601/01/2009
23215605/05/2010
23215609/12/2011
23215612/12/2012
12359402/03/2010

In the LOAD I do this:

LOAD Visitor_ID,

     date(min(Order_Date)) as Min_Date,

     date(max(Order_Date)) as Max_Date

FROM

Book1.xlsx

(ooxml, embedded labels, table is Sheet1)

Group by Visitor_ID;

So, this way I get the min and the max dates in separated fields, grouping by Visitor ID.

Regards,

Gabriel

Not applicable
Author

OK thanks Gabriel, i'd hoped that there was a way to do it without having to make any changes to the script.

thanks again

regards

Nicola

Anonymous
Not applicable
Author

It's also possible to make it without changes in the script.

Take a look on the attached file.

There i've created expressions on the table with min(Order_Date) and max(Order_Date).

Regards,

Gabriel

Not applicable
Author

Thanks very much Gabriel, work great.

regards


Nicola