Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
aveeeeeee7en
Specialist III
Specialist III

WeekDays Logic

Hi Community

I want to insert Weekdays Mon, Tue, Wed, Thu, Wed, Thu, Fri, Sat where Nulls are coming in Weekdays column

Logic to Apply:

1): If Flag='DC' than insert Weekdays Mon, Tue, Wed, Thu, Wed, Thu, Fri

2): If Flag='IDC' than insert Weekdays Mon, Tue, Wed, Thu, Wed, Thu, Fri, Sat

Original Data:

Originall111111.png

Required Data:

Requireddddddd1111.png

PFA.

Regards

Av7eN

11 Replies
preminqlik
Specialist II
Specialist II

hi try below for Little more simpler without loops and concatenation

Load *,

if(len(trim(WeekDays))=0,if(Flag='IDC',SubField('Mon-Tue-Wed-Thu-Fri-Sat','-'),SubField('Mon-Tue-Wed-Thu-Fri','-')),WeekDays) as FINALWEEKDAYS

from PATH;

aveeeeeee7en
Specialist III
Specialist III
Author

Prem & Tresesco Sir I like both of yours Approach.

Great Work of Mind.

Special Thanks to Jagan Mohan Sir for identifying duplicates in my Logic.

I was in so hurry that I missed that part of Duplicate Recoords. Later learnt that I was wrong.

Thank you All for providing such wonderful solutions and that too instantly.

Reagards

Av7eN