Avatar of Sailee Govekar
Sailee Govekar
Flag for India asked on

Replacing column with other column when Data is blank in Crystal report

Hi,

I want to replace the Column A with the adjacent Column B if column A data is NULL (dynamically shifting).

For more reference kindly find the attached image
Image1.jpg
Crystal ReportsSAP

Avatar of undefined
Last Comment
Mike McCracken

8/22/2022 - Mon
Pawan Kumar

Please use like below -

You have to write a crystal report formula-

if isnull({col1}) then {col2} 
else 
{col2}

Open in new window

Pawan Kumar

Edited my last comment.
Raghavendra Hullur

From the image, it seems you want to suppress the field Weight itself when the value is blank and shift other 5 fields to left is it?
If so, you need to set the x position dynamically.

Correct me if I am wrong.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Sailee Govekar

ASKER
Yes,

I want to shift the columns to the left when the Weight column is blank or null.

If the weight column is not null then it will display normally. without any column shifting.
SOLUTION
Raghavendra Hullur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Sailee Govekar

ASKER
I have one boolean field for viewing or suppressing weight column namely, IsWeightVisible

will it be useful?
Raghavendra Hullur

Not sure what is that used for.
Is it the one which give blank data or some data for Weight column? If yes, then you can use that instead of the field to check for blank.
If not, you need to use the field which gives the output for Weight column.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Raghavendra Hullur

Basically, we try to check whether the value for your Weight column is blank or not.
Sailee Govekar

ASKER
Yes, IsWeightVisible provides the condition whether the weight is available or not.
Sailee Govekar

ASKER
So if I create same fields like washing, drying, etc and set the suppressing property to True or False then it will work!

I suppose.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Raghavendra Hullur

You are not setting any suppressing, you will be writing X position shift formula for each of those  5 fields.
Raghavendra Hullur

Seems it's confusing for you? Share the report with some sample data. Unless there are additional calculations, it shouldn't take much time.
Sailee Govekar

ASKER
Kindly find the report on this path: https://drive.google.com/open?id=1BarTF3CSqMKyqWp15AGyXdp_AePSO0lS

Report Name : Report2

Secondly, I have implemented the suppressing format, because the formula you explained I didn't understood
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Raghavendra Hullur

I don't see the information you shared via screenshot in the report you attached. Is it the one you are working or is there any suppression? Can you share with same sample data or further details of section in which those details used?
Sailee Govekar

ASKER
Raghavendra Hullur

Hi,
This is what I see when I open your report.
Can you tell me which field will have blank data?
ShiftingFields.JPG
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Mike McCracken

Are the other 5 columns the same data types as the weight field?

If so you could do it with formulas

If IsWeightVisible  then
   {Weight Field}
Else
   {Washing field}

Similarly for the other 4 columns.

Suppress the last column with the IsWeightVisible  parameter

mlmcc
Sailee Govekar

ASKER
If you view the report, under field washing there is a field Weight
Raghavendra Hullur

I am still trying to figure out the Weight you said under Washing.

As per your original requirement, it's suppose to be on left of Washing, Drying etc..

But now you are saying Weight is under Washing, but that isn't visible at all.

All I see is a OLE object then a text object with message "Do not wash - non lavare", then another OLE object followed by the same message displayed earlier.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Sailee Govekar

ASKER
I have deleted the the fields for your understanding.

https://drive.google.com/open?id=1hSVtRkFNvYH9xxPW29E0uhQ__mAz-VJi
Raghavendra Hullur

Can you explain with reference to the latest report you shared on what field you want to move. it would be better you have screenshot of latest report with instructions on what fields to be moved without changing anything further. You are changing the content again and again which is not helping to resolve the issue.
Mike McCracken

I think you have it working with weight suppressed and washing moved over.  Just do the same thing for the other objects.  Create a copy and put it one column left.  Same for the big header make a copy and move it left.  Use the same suppression.  

mlmcc
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Raghavendra Hullur

Oh, I didn't think of that. Yes, I could see those 2 fields overlapped from the Report Explorer. But I can also see that there is no dynamic position is applied on the Washing field. Position formula needs to be changed for the same.
ASKER CERTIFIED SOLUTION
Mike McCracken

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Raghavendra Hullur

Yes, that is also a better idea. I hope @Sailee knows about this. Else, we could help her.
Mike McCracken

She is using it on the weight and wash fields.  Just a matter of extending to all fields.

mlmcc
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.