on 07-27-2012 5:05 PM
if ({ZAR_VRM30_Q007.Document Number}=previous({ZAR_VRM30_Q007.Document Number})) and
{@Gross billing_1} = 0 and {ZAR_VRM30_Q007.Net Billing} = 0 and {@Cash Receipts} = 0 and {ZAR_VRM30_Q007.Retainage based on Currency Type} <> 0
then
previous({ZAR_VRM30_Q007.Retainage based on Currency Type}) = {ZAR_VRM30_Q007.Retainage based on Currency Type}
Hi ,
I have a scenario where I have to move the current record value to previous record column.
As highlighted in the above screenshot, I'm comparing two records which have same billing doc no and see if the retainage is shown in second record.
If yes, see that second records gross billing, net billing values are 0, then move the retainage to previous record.. In this example: value 141,417.17 should be moved to the previous record leaving its value 0 in the second record.
I tried using if statement to satisfy the condition and its working but I'm not able to assign the retainage value to first record column. Here I'm getting only true and false values.
Please see the code below:
if ({ZAR_VRM30_Q007.Document Number}=previous({ZAR_VRM30_Q007.Document Number})) and
{@Gross billing_1} = 0 and {ZAR_VRM30_Q007.Net Billing} = 0 and {@Cash Receipts} = 0 and {ZAR_VRM30_Q007.Retainage based on Currency Type} <> 0
then
previous({ZAR_VRM30_Q007.Retainage based on Currency Type}) = {ZAR_VRM30_Q007.Retainage based on Currency Type}
Please let me know how to achieve this requirement.
Thanks for all the help!
John
Hi John,
The formula outputs True or False because the last line of your formula is trying to compare two values and see if they're equal.
previous({ZAR_VRM30_Q007.Retainage based on Currency Type}) = {ZAR_VRM30_Q007.Retainage based on Currency Type}
will always output True or False.
Change the last line to just:
{ZAR_VRM30_Q007.Retainage based on Currency Type}
Hope this helps!
- Abhilash
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
Share Your Knowledge in SCN Topic Spaces
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
Could you please attach the report with saved data. I do not see the retainage column in the above screenshot and anyway it becomes easier with the report itself.
Before you attach the report, please change the extension to .txt.
- Abhilash
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
Hi Abilash,
Please see the attached report in .txt format
As mentioned above, there are two records with same billing doc no.(9000000012), with the second record having no values for all key figures except for retainage. In that case we have to move the retainage to the previous record making its value 0 in the second record.
Thanks,
John
Hi John,
The report you sent to me does not have contain data, so I could not test this solution.
Could you see if this works:
1) Create this formula and place it on the details section:
if ({ZAR_VRM30_Q007.Document Number}=next({ZAR_VRM30_Q007.Document Number})) then
(
if next({ZAR_VRM30_Q007.Retainage based on Currency Type}) > 0 OR next({ZAR_VRM30_Q007.Retainage based on Currency Type}) < 0) then
(
if next({ZAR_VRM30_Q007.Net Billing}) = 0 then
(
if (next({ZAR_VRM30_Q007.Document Type\Document Type - Key}) = 'IW' or next({ZAR_VRM30_Q007.Document Type\Document Type - Key}) = 'LC') then
(
if next({ZAR_VRM30_Q007.Amount based on Currency Type}) = 0 then
(
if next({ZAR_VRM30_Q007.Retainage based on Currency Type}) <> 0 then
(
next({ZAR_VRM30_Q007.Retainage based on Currency Type})
)
)
)
)
)
2) Go to Section Expert > Select the Details section > click on the formula button beside Suppress and use this formula:
if ({ZAR_VRM30_Q007.Document Number}=previous({ZAR_VRM30_Q007.Document Number}) and {ZAR_VRM30_Q007.Retainage based on Currency Type} <> 0) then
true else false
Please test this and let me know if this works.
Otherwise, send me the report with saved data and I'll play around this get back to you.
- Abhilash
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
Hi John,
What version of Crystal Reports for Enterprise are you using?
I tested this report (on CR4E SP04) and it works fine. The formula shows the correct retainage values on the repeating records.
Why so many duplicate posts ?
- Abhilash
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.