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

Create total without dimension

Hi i am trying to do a sum of a field without a dimension

My data looks like this:

TranscactionIDCustomerIDOrderValue
11111100
2250
34551
4455150
545556
622467
7579269
89364

I want to get the first ordervalue recorded for each customerid and compare it to the most recent ordervalue for that same customer and see if it is greater, if it is i want to count it.

I can then show "95 orders placed that are greater than first order value" in a text object rather than a chart.

How do i do this? Aggr? FirstSortedValue?

Thank you.

1 Solution

Accepted Solutions
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Hi Liam,

Yes, you could use Aggr() with FirstSortedValue().  See attached QVW that uses the following expression:

=Sum(Aggr(If(FirstSortedValue(OrderValue,-TranscactionID,1) > FirstSortedValue(OrderValue,TranscactionID,1),1,0),CustomerID)) & ' orders placed that are greater than the first order value'

Hope this helps,

Jason

View solution in original post

3 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Hi Liam,

Yes, you could use Aggr() with FirstSortedValue().  See attached QVW that uses the following expression:

=Sum(Aggr(If(FirstSortedValue(OrderValue,-TranscactionID,1) > FirstSortedValue(OrderValue,TranscactionID,1),1,0),CustomerID)) & ' orders placed that are greater than the first order value'

Hope this helps,

Jason

Not applicable
Author

Jason Michaelides that is great - thank you

Not applicable
Author

yes do what jason told to u it is correct i think