Page 1 of 2

What does 'output row only once' will do in filter

Posted: Thu Jul 18, 2013 12:08 am
by Prince_Hyd
Hi folks

In filter we have an option like "output row only once" what's the functionality of this option can anyone explain with example



Thanks

Re: What does 'output row only once' will do in filter

Posted: Thu Jul 18, 2013 12:19 am
by SURA
It is clearly mentioned in the stage Information text.

Code: Select all

Type: List
Set to true to output the row only to the first 'Where Clause' it matches; False means the row will be output to all 'Where Clauses' that match.
To get the full understanding create a dummy data and test it. So that you can feel the difference.

It will not pass the record to second where condition...

Posted: Thu Jul 18, 2013 4:24 am
by jpraveen
Suppose if u had two where conditions,

1st where condition:- Dept no =10

The condition met records will pass into Target1

2nd Where Condition :- Dept no in (10,20,30,40)

If you use 'output row only once' , Then the record will not pass the second where condition and it will not go to Target2.

if you are not using 'output row only once' , then the record will pass into 2 Targets.

Posted: Thu Jul 18, 2013 4:26 am
by jerome_rajan
Is this a bit like the 'Otherwise' functionality in the PX Transformer?

Posted: Thu Jul 18, 2013 4:55 am
by ArndW
The "otherwise" will output every row that doesn't match any of the conditions in the previous constraints for links, which is a bit different from what the "output row only once" does.

Re: It will not pass the record to second where condition...

Posted: Thu Jul 18, 2013 9:00 am
by Prince_Hyd
Tats superb explanation.I got it.But as you mentioned in second condition that we have to write deptno in(10,20,30) when i'm writing this condition in filter compilation is going fine but while i run the job i'm getting error how come??

i wrote like

First condition deptno = 10

Second condition deptno in(10,20,30)

how come running is getting failured.


Thanks

Posted: Thu Jul 18, 2013 9:33 am
by chulett
Perhaps you should mention the actual error or issue. Ah...

Please do not put needed information in the subject when replying as others will not be able to see it unless they start a reply, like I just did.

"Re: It will not pass the record to second where condition..."

Is this your "failure" or is there more to it than that?

Posted: Thu Jul 18, 2013 4:26 pm
by ray.wurlod
I don't recall that IN is supported in the Filter stage.

Rather you need multiple WHERE conditions each directing to the same output link number. Output links are numbered from 0.

Posted: Fri Jul 19, 2013 12:21 am
by Prince_Hyd
Hey Ray

I tried your solution but it din't worked.Any other way?




Thanks

Posted: Fri Jul 19, 2013 12:47 am
by ray.wurlod
It DOES work.

Show me exactly what you did, and explain what you mean by "din't worked".

Posted: Fri Jul 19, 2013 12:58 am
by Prince_Hyd
i have input table like this

cust_id,cus_name,deptno
1,uma,10
2,varun,20
3,siva,30
1,rathode,40

and in filter i mentioned first where condition as

1) where =deptno=10 to output link 0

and second where clause as

2)Where =deptno=10 to output link 1

and third where clause as

3)Where = deptno=20 to output link 1

while compiling the job is successfully completed but while running i'm getting failure

Posted: Fri Jul 19, 2013 2:19 am
by ray.wurlod
WHAT failure?

Right now your diagnosis is in the same league as "my car won't start" and you expect us to guess at the cause.

Post full details of any error messages you have received.

What's the data type of deptno?

Posted: Sat Jul 20, 2013 11:22 am
by Prince_Hyd
Hi ray

Failure means when you compile you get blue line when you run if success green will come else red for failure so like that i got red line.

Any how i find another solution like in filter we can keep like deptno <=40 where it will cover all the dept's.



Thanks.

Posted: Sat Jul 20, 2013 4:06 pm
by ray.wurlod
A red line indicates that the job has aborted. You then look in the job log to find out what caused the job to abort. I have already asked you to post that information, and am still waiting.

Posted: Sun Jul 21, 2013 12:31 am
by Prince_Hyd
Hi ray

I got error like this in log file

Filter_1:Error occured during initialize from Args()
Filter_1:Parse error;Expected comparision operator('>','<')after literal,got:<eof>.(....)
main_program:Creation of a step finished with status = Failed

see if i give condition like below it works fine

where deptno=10
output link =0

deptno=10
outputink=1

deptno=20
oututlink=1

supose if i give like this
where deptno=10
output link =0

deptno=10
outputink=1

deptno=20
oututlink=1

deptno=30
outputlink=1


then i get error

but as is said i got the solution after i checked the log file

Thanks for your response.