Skip to main content
Announcements
You can succeed best and quickest by helping others to succeed. Join the conversation.
cancel
Showing results for 
Search instead for 
Did you mean: 
kesav697921
Contributor
Contributor

Fecthing data from another table based date field in other table

I have requirement like based one date filed i need to go back of 2 business working days and need to get the status of that particular date. let me explain with the sample data

Excitement:

Report_DateCandidate_IDStatus
3/20/201912Low
3/20/201913Low
3/21/201912Med
3/21/201913Low
3/22/201912Med
3/25/201912High
3/25/201913Med
3/26/201912High
3/26/201913Med
3/27/201912Low
3/28/201912High
3/29/201912High

 

Joinerlist:

Candidate_IDStrat_Date
124/1/2019
133/28/2019
144/2/2019

 

Here we need to get details of candidates who was their in Excitement table based on the  Strat_Date field. Note: From Strat_Date we need to go back to the 2 business working days at that we need to get the details of candidate Status.

Ex: for Canidate -12  

Strat_Date was 4/1/2019

so we need to go to the Report_Date =3/28/2019

on this date we need to get Status here it is 'High'

 

At last we need to get output like this

Strat_DateHighMedLow
4/1/2019100
3/28/2019010
4/2/2019000

 

Kindly help me on this issue.

2 Solutions

Accepted Solutions
pradosh_thakur
Master II
Master II

Coming to your question modify the script similar to below , create a field report_date in the Joiner list table 

 

load * , if(weekday(Strat_Date)=0 or weekday(Strat_Date)=1,date(Start_Date-4), date(Start_Date-2)) as report_date 

 

Then you can join/ associate both the table using them and get it in your required format. Try and let me know.

 

-Pradosh

Learning never stops.

View solution in original post

PrashantSangle

USe below logic
In script
Excitement:
Load Report_Date&Candidate_ID as key,Status Inline [
Report_Date, Candidate_ID, Status
3/20/2019, 12, Low
3/20/2019, 13, Low
3/21/2019, 12, Med
3/21/2019, 13, Low
3/22/2019, 12, Med
3/25/2019, 12, High
3/25/2019, 13, Med
3/26/2019, 12, High
3/26/2019, 13, Med
3/27/2019, 12, Low
3/28/2019, 12, High
3/29/2019, 12, High
];

candidate_id:
Load Start_Date,Date(Num(Start_Date)-3)&Candidate_ID as key Inline [
Candidate_ID, Start_Date
12, 4/1/2019
13, 3/28/2019
14, 4/2/2019
];

In front table
Take Straight Table
Dimension : Start_Date
Expression
1: High >Count({<Status={'High'}>}Status)
2: Med > Count({<Status={'Med'}>}Status)
3: Low > Count({<Status={'Low'}>}Status)

Regards,
Prashant Sangle
Great dreamer's dreams never fulfilled, they are always transcended.

View solution in original post

3 Replies
pradosh_thakur
Master II
Master II

Hi @kesav697921  

 

When you want to tag someone start with an @ then type the name , for example you wanted to tag sunny so do it like @sunny_talwar  and he will be notified

Learning never stops.
pradosh_thakur
Master II
Master II

Coming to your question modify the script similar to below , create a field report_date in the Joiner list table 

 

load * , if(weekday(Strat_Date)=0 or weekday(Strat_Date)=1,date(Start_Date-4), date(Start_Date-2)) as report_date 

 

Then you can join/ associate both the table using them and get it in your required format. Try and let me know.

 

-Pradosh

Learning never stops.
PrashantSangle

USe below logic
In script
Excitement:
Load Report_Date&Candidate_ID as key,Status Inline [
Report_Date, Candidate_ID, Status
3/20/2019, 12, Low
3/20/2019, 13, Low
3/21/2019, 12, Med
3/21/2019, 13, Low
3/22/2019, 12, Med
3/25/2019, 12, High
3/25/2019, 13, Med
3/26/2019, 12, High
3/26/2019, 13, Med
3/27/2019, 12, Low
3/28/2019, 12, High
3/29/2019, 12, High
];

candidate_id:
Load Start_Date,Date(Num(Start_Date)-3)&Candidate_ID as key Inline [
Candidate_ID, Start_Date
12, 4/1/2019
13, 3/28/2019
14, 4/2/2019
];

In front table
Take Straight Table
Dimension : Start_Date
Expression
1: High >Count({<Status={'High'}>}Status)
2: Med > Count({<Status={'Med'}>}Status)
3: Low > Count({<Status={'Low'}>}Status)

Regards,
Prashant Sangle
Great dreamer's dreams never fulfilled, they are always transcended.