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

Conditional field from backend which depends upon the value of record no 1 and record no 2 values...

Hi QV Guys,

I have to create one conditional field which depends on row values in backend script.Capture.JPG

condition: (for the field which is generating with respective of existing fields)

IF (1st record Days<>'NA' and 2nd Record Days <>'NA'),'Backlog','0')

Here Case Number should be same while checking the 1st record and 2nd record..

Attached is the sample data table..

1 Solution

Accepted Solutions
chandu441
Creator
Creator
Author

Hi All,

Here is the resolution which is success.

NoConcatenate

FINAL_DATA:

LOAD

*,

IF([Opened Date]>Finish OR [Closed Date]<[Start],'NA',

IF([Closed Date]<Finish,[Closed Date]-[Opened Date],

IF([Closed Date]>Finish,Finish-[Opened Date]

,'NA'))) AS DAYS,

'FW'&' '&FW&'-'&Right(YEAR_YYYY,2) AS Week_Year

Resident SFDC

Order by [Case Number],Start_Num desc,;

DROP Table SFDC;

Final:

Load *,

IF ( ( [Case Number] = Previous([Case Number]) ) AND (DAYS<>'NA' and Previous(DAYS)<>'NA') ,'Backlog','Null') as BL

Resident FINAL_DATA;

DROP Table FINAL_DATA;

View solution in original post

5 Replies
Anil_Babu_Samineni

Can you create some thing like this after environment

Set Nullinterpret = '%';

NullasValue DAYS;

Set NullValue = 'Backlog';

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ahaahaaha
Partner - Master
Partner - Master

Hi,

May be like this

IF (1st record Days<>'NA' and 2nd Record Days <>'NA' and [Case Number] = Above([Case Number]),'Backlog','0')

chandu441
Creator
Creator
Author

Sorry I didn't get you what you have suggested..

I have to create one more conditional field which the logic is mentioned above.

Thanks for your reply.

chandu441
Creator
Creator
Author

Thanks for your reply Andrey,

Condition is ok.., 1st record and 2nd Record is mentioned for your understanding Field name is DAYS which is in screenshot how can i include the condition to select second record DAYS value is the problem?

chandu441
Creator
Creator
Author

Hi All,

Here is the resolution which is success.

NoConcatenate

FINAL_DATA:

LOAD

*,

IF([Opened Date]>Finish OR [Closed Date]<[Start],'NA',

IF([Closed Date]<Finish,[Closed Date]-[Opened Date],

IF([Closed Date]>Finish,Finish-[Opened Date]

,'NA'))) AS DAYS,

'FW'&' '&FW&'-'&Right(YEAR_YYYY,2) AS Week_Year

Resident SFDC

Order by [Case Number],Start_Num desc,;

DROP Table SFDC;

Final:

Load *,

IF ( ( [Case Number] = Previous([Case Number]) ) AND (DAYS<>'NA' and Previous(DAYS)<>'NA') ,'Backlog','Null') as BL

Resident FINAL_DATA;

DROP Table FINAL_DATA;