| Author |
Message |
Macavity
Groupie
Joined: 24 Sep 2012
Online Status: Offline
Posts: 93
|

Topic: change previous values Posted: 27 Sep 2013 at 5:40am |
|
Hi, there wouldn't be by any chance be a way to change previously read values on a report ?
example component price a 12,00 b 25,00 c 0,00 d 32,00
when one component has price 0 then the report should show all components price 0,00
|
IP Logged |
|
|
|
Sastry
Moderator
Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
|

Posted: 27 Sep 2013 at 6:20am |
|
Hi
Do the following :
Create one formula like
if Price = 0.00 then 0 else 1
insert this in your detail and insert summary.
Now insert a count on component and compare component count = summary then price else 0
Example data :
component price formula
a 12,00 1
b 25,00 1
c 0,00 0
d 32,00 1
--- -----
4 count 3 summary
Now compare both count and summary
|
|
Thanks,
Sastry
|
IP Logged |
|
kostya1122
Senior Member
Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
|

Posted: 27 Sep 2013 at 6:21am |
|
you could try something like a formula if minimum(price) = 0 then 0 else price
|
IP Logged |
|
Macavity
Groupie
Joined: 24 Sep 2012
Online Status: Offline
Posts: 93
|

Posted: 28 Sep 2013 at 5:38am |
|
yes, but the result should be : component price formula
a 0,00 1
b 0,00 1
c 0,00 0
d 0,00 1
--- -----
|
IP Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

Posted: 03 Oct 2013 at 5:07am |
|
you can still have the formula that sets the 1 and 0...the 'actual' data is still valid, you are just altering the display...
In regards to kostya1122, his solution did match what your original post asked for...if 1 component is 0, then they all are.
|
IP Logged |
|
Macavity
Groupie
Joined: 24 Sep 2012
Online Status: Offline
Posts: 93
|

Posted: 08 Oct 2013 at 3:57am |
|
Problem
if minimum(@price) = 0 then 0 else 1
this field cannot be summarized
@price is a shared numbervar from a subreport
anyway to solve this ?
|
IP Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

Posted: 08 Oct 2013 at 4:48am |
|
shared variables.
in this case the value is 'apparent' in the data and so cannot be summarized.
going a bit further, I doubt that minimum is making any difference as @price only has 1 value...the last one...unless it's an array, but I am not sure how that works (don't use arrays too often).
Also, since it a shared variable from a subreport, you cannot summarize it, as the value of the variable is not known before the subreport runs. To be summarized, the information has to be available in the raw data...so you can do counts like:
if {table.field } > x then 1 else 0
or
sum({table.field}, {grouping info})
as the data is there...subreports and other formulas that can only be determined at run time cannot be summarized.
it's just how I remember what can and cannot be summarized
HTH
|
IP Logged |
|
Macavity
Groupie
Joined: 24 Sep 2012
Online Status: Offline
Posts: 93
|

Posted: 09 Oct 2013 at 4:40am |
|
The only way I see to solve this :
on the group header create a subreport that does the same as the main report. In the subreport at the end we know we encountered a zero, return a flag to the main report. now on the main report everything is read again, but now we have a flag to set prices to zero.
|
IP Logged |
|
|
|