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

Test row data before aggregation.

Hi I need help with an issue, I'm struggling to find a solution for this :

I need to test some values before being aggregated, like the example :

This is my data :

MonthName DateA

DateA
DateB
ValueA
ValueB
Jan 201205-Jan-1210-Jan-1210001000
Jan 201210-Jan-1210-Jan-12500300
Feb 201210-Feb-1205-Feb-1220001500
Feb 201210-Feb-1205-Feb-1230003000

What I want to display :

MonthName DateA
Sum(ValueA)
Sum(ValueB)
Expression
Jan 201215001300300
Feb 2012500045004500

The Expression being:

if(DateB <= DateA, ValueB, 0)

The expression obviously doesn't work because the data was aggregated demanding me to aggregate the values, however, I can't see how I can filter the values before the aggregation, if I do :

if(Min(DateB) <= Min(DateA), Sum(ValueB), 0)

I'll get wrong data cause it will not compare the dates in the row, but rather all dates from the month, and either not filter any values or filter all, depending on the combination of max/min functions that I choose.

Does anyone know how to make this ?

I'd be grateful if you could post the solution, not the qvw, as I'm using a personal version and can't open other people's qvws.

Thanks in advance.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I would think this would work:

sum( if(DateB <= DateA, ValueB, 0) )

-Rob

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I would think this would work:

sum( if(DateB <= DateA, ValueB, 0) )

-Rob

Not applicable
Author

Such a simple solution, thanks a lot.