Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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.

Tags (2)
1 Solution

Accepted Solutions
jason_michaelid
Honored Contributor II

Re: Create total without dimension

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

3 Replies
jason_michaelid
Honored Contributor II

Re: Create total without dimension

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

Re: Create total without dimension

Jason Michaelides that is great - thank you

Not applicable

Re: Create total without dimension

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

Community Browser