Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: How to filter inactive data Post Reply Post New Topic
Page  of 2 Next >>
Author Message
shiloh
Newbie
Newbie


Joined: 13 Oct 2011
Online Status: Offline
Posts: 26
Quote shiloh Replybullet Topic: How to filter inactive data
    Posted: 20 Oct 2011 at 4:26pm
Hi,

Does anyone know how to filter inactive data in crystal report XI formula?

I have a field call warehouse:
(if {@Warehouse} <>''
    then{G.Warehouse} = {@Warehouse}
else true
)
This will call out all the warehouse included active and inactive.

I try to filter warehouse.isactive =1 but is not working

Can anyone please advice on my code.

Thanks a lot
IP IP Logged
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Posted: 21 Oct 2011 at 2:10am
do you mean NULL data (blank data)

If so, then simply write a formula called {@nullcheck} :

IF isnull{@warehouse} THEN FALSE ELSE TRUE
 
 
then drop this formula into the select and set it as  'is equal to TRUE'
 
 
if thats not what you mean, then please give more detailed details

Regards,

Michael Jones
IP IP Logged
shiloh
Newbie
Newbie


Joined: 13 Oct 2011
Online Status: Offline
Posts: 26
Quote shiloh Replybullet Posted: 21 Oct 2011 at 4:08am
Is not this.

In my product table have a column call "warehouse" field. I also have a warehouse table to keep the warehouse information.In warehouse table there is column/field call "IsActive" So, if the warehouse is inactive the value is = 0, if active the isactive column value=1.

When i link my product table to the warehouse table, i need to filter those isactive <>0 then product.warehouse. I do using select expert to set "warehouse.isactive" = true.

But I try is not working and ask for a boolean.

I not sure will you get what i mean here.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Oct 2011 at 7:15am
warehouse.isactive <>0
IP IP Logged
shiloh
Newbie
Newbie


Joined: 13 Oct 2011
Online Status: Offline
Posts: 26
Quote shiloh Replybullet Posted: 21 Oct 2011 at 3:53pm
Originally posted by DBlank

warehouse.isactive <>0

already try not working.

I do like this:
(if {@Warehouse} <> '' and {Warehouse.IsActive} <>0
then {G.Warehouse} = {@Warehouse}
else true)

the error message is "A Boolean is require here" the error is highlight at the value "0"



Edited by shiloh - 21 Oct 2011 at 4:55pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Oct 2011 at 5:24pm
I don't know what your @warehouse formula is doing but the you can't have a then statement that alters existing data fields so it does not make any sense to me.
If isactive is a Boolean field then just use
And {Warehouse.IsActive}

If isactive has your 1/0 data then use
And {Warehouse.IsActive}=1

Edited by DBlank - 21 Oct 2011 at 5:25pm
IP IP Logged
shiloh
Newbie
Newbie


Joined: 13 Oct 2011
Online Status: Offline
Posts: 26
Quote shiloh Replybullet Posted: 21 Oct 2011 at 5:49pm
My warehouse formula only have " ' '" just to capture data key in by user, or user can just select from the selection record.

This is depend on the setting I did in the system and then link to CR report.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Oct 2011 at 3:26am
You mean you have a user entered parameter?
IP IP Logged
shiloh
Newbie
Newbie


Joined: 13 Oct 2011
Online Status: Offline
Posts: 26
Quote shiloh Replybullet Posted: 23 Oct 2011 at 5:27pm
Originally posted by DBlank

You mean you have a user entered parameter?

Initial yes, user can enter through parameter.

Now I want to get the data from the database table so user can select their warehouse. I using back the same parameter. Just need to add the condition. But how I try the parameter is not working for that. Is still get all the data out from database instead of filter out the inactive warehouse
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Oct 2011 at 4:24am

Are you tryng to filter the data set that appears in the body of the report 

 or
are you trying to filter a pick list (a parameter pick list with a list of values showing the 'active' warehouses) for when the user runs the report?
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.