Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare Each Record to Records

Status
Not open for further replies.

madcrystal

Technical User
May 5, 2011
8
US
I have a union that pulls in data that looks like this:

a 1 2 0 0
b 1 2 0 0
c 1 2 0 0
a_a 0 0 1 2
b_b 0 0 1 2
c_c 0 0 1 2

What I'm trying to do is match each dimension with it's corresponding dimension and return the relating measures. So, for instance:

foreach record {
if(a = right("a_a"; 1)) { return measure }
}

The result would be outputting:

a 1 2 1 2
b 1 2 1 2

Anyone tackle this in the past?
 
Can you have the second part of your union return a instead of a_a? If so, you can just sum the columns to get your data. If not, create a formula that you can group on that looks something like this:

right({table.col1}, 1)

This should return "a" for both "a" and "a_a". Group on this formula and sum the numbers to get your desired output.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top