Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
madhubabum
Creator
Creator

how to delete inactive department id's in Department Field

Hi All,

I have one Department Field , and we are having some inactive department Id's in that Department field.....

Then how can we Remove those in active fields...

Thanks in Advance

madhu

5 Replies
awhitfield
Partner - Champion
Partner - Champion

Hi Madhu,

there's no much detail here to give advice on, rather than deleting it, don't load it!

Andy

swuehl
MVP
MVP

Remove the complete records?

Try using a WHERE clause with Exists():

InactiveDept:

LOAD * INLINE [

Inactive

A

B

];

Dimension:

LOAD Department INLINE [

Department

A

B

C

D

E

]

WHERE NOT EXISTS(Inactive, Department);

DROP TABLE InactiveDept;

pokassov
Specialist
Specialist

Hello!

You can do this

inner join (your_table_with_department_id)

load distinct

     department_id

resident your_table_with_fact_where_you_can_find_active_department;

sunny_talwar

You want them to be removed in the script itself??

you can use a where clause in your table those are coming in, probably something like this:

Where Year(Max(ActivityDate)) >= 2

Group By DepartmentID;

This is saying that if a certain DepartmentID is not active for more than 2 years, drop it off.

For more help on the topic, you will need to give more details.

HTH

Best,

Sunny

jonas_rezende
Specialist
Specialist

Hi.

Status_Department:

1 = Active;

0 = Inactive.

Use something like this:

Department:

Load

DepartmentId

DepartmentName,

Status_Department

from <name table>

where

Status_Department = 1;

STORE [Department] INTO [..\<name table>.qvd]  (qvd);

Hope this helps!