Print Page | Close Window

Record selection formular

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22270
Printed Date: 28 Apr 2024 at 2:42am


Topic: Record selection formular
Posted By: lozaldiniho
Subject: Record selection formular
Date Posted: 22 Mar 2017 at 7:22am
I'm a bit of a novice with this and have read post upon post, so apologies if it's really obvious and i've posted this in the wrong place etc...

Currently my data looks like this in preview mode:

SKU | Name | Selling Price | Price Rule | Price Rule Value

001 | Football | £20           | NOW          | £20
002 | TV        | £200          | NOW          | £200
003 | Shirt      | £50             | NOW          | £50
001 | Football | £20             | RRP            | £30
002 | TV          | £200          | RRP            | £250

I want the user to be able to select several SKUs (which I have worked out on select expert), and then only show the RRP rule unless it doesn't exist and then show the NOW rule.

Ideally user selects SKU's 001, 002 & 003 and gets this back:

SKU | Name | Selling Price | Price Rule | Price Rule Value

003 | Shirt      | £50             | NOW          | £50
001 | Football | £20             | RRP            | £30
002 | TV          | £200          | RRP            | £250

Thanks in advance! I'm using Crystal reports 2013

Lawrence






Replies:
Posted By: DBlank
Date Posted: 22 Mar 2017 at 1:54pm
if this is just about display and not calculations you can sort by SKU and Proce Rule then conditionally suppress a row using next() or previous() functions comparing the SKU and Price Rule values
maybe like this?
(Not onfirstrecord) and (previous(sku) = SKU and PriceRule = 'RRP')


Posted By: DBlank
Date Posted: 22 Mar 2017 at 1:55pm
The prior post assumes there are only up to two possible rows and each one is either RRP or NOW


Posted By: lozaldiniho
Date Posted: 22 Mar 2017 at 11:07pm
DBlank, thank you for the reply. In theory this sounds like it could work, thank you.

I've had a go at the Conditional Suppression, I did this via Section Expert > Details > Ticked Suppress (no drill down)
Clicked the formula and written the following:

(Not onfirstrecord) and (previous({tbleProduct.SKU}) = {tbleProduct.SKU} and {vw_OA_PriceRuleDetail.PriceRule} = 'RRP')

I don't get any errors upon Save&Close, but on the preview I don't see any changes to the data either, I still have Now & RRP price rules for the SKU?

Sorry if i've misunderstood your instructions. Any further thoughts?

Thanks again, Lawrence


Posted By: lozaldiniho
Date Posted: 22 Mar 2017 at 11:53pm
DBlank, I think I might have it working! I did the following:
(Not onfirstrecord) and (previous({tbleProduct.SKU}) = {tbleProduct.SKU} and (previous( {vw_OA_PriceRuleDetail.PriceRule} = 'RRP'))

I'll keep testing, thanks for your help.



Print Page | Close Window