Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need a logic for this date data?

Hi Folks,

I have the data from 01/01/2014 to 12/31/2014. here i want to exclude some dates as per my logic.I tried some couple of things but i didnt get any proper output.

I have attached the excel here.i need all the data except of exclude dates.here i want to exclude all the data which is haing less than Flag.

for example i have a LESS THAN flag and it is having the date -7/17/14

i want to exclude all the dates from 01/01/2014 to 07/17/14. i need a data from 07/18/2014.

Plz suggest me with the logic on this.


6 Replies
datanibbler
Champion
Champion

Hi,

seems easy: If you have that LESS THAN flag with the timerange to exclude, that means the date in that flag_field is actually your start_date, so you have to replace 1/1/year with that date.

You can first load your full data_table, then load that comparison_table, then join the two on a suitable field and if you get a LESS THAN date from that comparison_table, then use that, otherwise use 01/01/year as your start_date - you can generate a third field to calculate that.

HTH

Not applicable
Author

Thanks DataNibbler,

But here i have two dates with two LESS THAN flag values.when i am trying it is taking only one date range only.

i am using it use of for loop.

chematos
Specialist II
Specialist II

You could createa table containing all the dates you want to non include to your data model and use the exists function in your load statement:

Lets say you have a table with all the dates to exclude in a field named Date.

Then, load your fact table:

Fact:

Load * from FactTable

where not exists(Date,Date);

Regards,

Jose

Not applicable
Author

Hi,

I have dates table that is having 01/01/2014 to 12/31/2014.

i need the list of exclude dates.Plz send me the logic code for this scenario.

ashfaq_haseeb
Champion III
Champion III

Hi,

Check if this helps

Calculating Holidays in script

Regards

ASHFAQ

sindu_bharathi
Partner - Contributor III
Partner - Contributor III

Hi Rakesh,

Use the below logic.

LOAD
[Date Exclude]as Dates

FROM
[..\Data\Date range.xlsx]
(ooxml, embedded labels, table is Sheet1)
where wildmatch(Flag, 'Less than');

noconcatenate

Date:
LOAD Dates
FROM
[..\Data\Dates 1-12.xlsx]
(ooxml, embedded labels, table is Sheet1)
where not exists(Dates);

drop table DateRange;

Hope it helps.

Regards,

Sindu