Author |
Message |
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|
Topic: variables don't seem to be working Posted: 30 Jul 2013 at 8:53am |
so, in my report i'm initializing variables in the header, setting the variables in the output (supressed) and then calling the variable in the footer as to get one single line with all of my data for each employee.
I've got several formulas that look at one field that has many results and it's shows a true or false depending upon the data in the field. when i run the report it's returning all false however if i look at the raw data in sql i can see that several should be true.
i'm not quite sure what's happening.
any thoughts?
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 30 Jul 2013 at 10:01am |
unsuppress them in the detail row and see what is happening there.
|
IP Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|
Posted: 30 Jul 2013 at 10:04am |
i tried that and then it just shows me several records for the first field only (emp id) and then shows me the footer. it's weird i'm not sure what is bunking out on this report.
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 30 Jul 2013 at 10:17am |
but did you get the correct T/F value per record (assuming you are updating the value per row)?
Can you show your formula?
|
IP Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|
Posted: 30 Jul 2013 at 10:21am |
here is the formula
If {ETax.tcode} In ["MED", "SS"] Then "Y" Else If NOT ({ETax.tcode} In ["MED", "SS"]) Then "N"
super simple
in the footer it shows N,N,N,N,N
when in fact it should be N,Y,N,N,Y
if i look at each individual line it would look like
N N N Y N Y N N N N N Y N N N N Y N N N
i thought maybe the variable was resetting too soon so i tried it without it and still got the same results.
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 30 Jul 2013 at 10:31am |
where are you concantenating it?
|
IP Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|
Posted: 30 Jul 2013 at 10:35am |
in the footer i'm calling the variables like
var1 + "," + var2 "," and so on
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 30 Jul 2013 at 10:45am |
you can just use one formula to run through all the rows.
You need one formual in GH to set the variable to blank
one to run through the data (details
one to display (GF)
//group header
shared stringvar x;
x : = ""
//detail
shared stringvar x;
x : = x + (If {ETax.tcode} In ["MED", "SS"] Then "Y, " else "N, ");
//footer
shared stringvar x;
x := left(x,len(x)-2)
Edited by DBlank - 30 Jul 2013 at 11:39am
|
IP Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|
Posted: 30 Jul 2013 at 11:27am |
Thanks DBlank! for some reason still no luck. I'll do some more digging tomorrow.
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 30 Jul 2013 at 11:39am |
to trouble shoot
unsuppress the detail section
place the detail formula next to the tcode field and watch how they interact to see if you can find a pattern
|
IP Logged |
|
|