Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ramu_i
Creator II
Creator II

Date range wise display the flag

Hi All,

I have Date filed format is DD-MM-YYYY

I want to get Particular date wise flag

Jan -1-2021 to Jan-15-2021  It will display the Period 1

Jan-16-2021 to Feb-25-2021 ---- Period 2

same way all dates, Between two dates rage --- display the period 

 

Thanks advance 

2 Replies
anat
Master
Master

i think so date range is not fixed format so create excel file and use interval match to get periods

Dim_Table:
ST_DT,ED_DT,PERIOD
Jan -1-2021,Jan-15-2021,Period 1
Jan-16-2021 , Feb-25-2021, Period 2

AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hello @Ramu_i ,

Here is an example of solution.

CalendarMaster:
LOAD
Date(InvoiceDate) AS InvoiceDate,
Year(InvoiceDate) AS Year,
'Q' & Ceil(Month(InvoiceDate) / 3) AS Quarter,
Week(InvoiceDate) As Week;
Load Date(MinDate + IterNo() -1 ) AS InvoiceDate While (MinDate + IterNo() - 1) <= Num(MaxDate);
Load
'01/01/2021' AS MinDate,
'12/31/2021' AS MaxDate
AutoGenerate 1;

Table:
Load Date(Date#(StartDate,'MMM-DD-YYYY')) as StartDate, Date(Date#(EndDate,'MMM-DD-YYYY')) as EndDate,Period Inline [
StartDate,EndDate,Period
Jan-1-2021,Jan-15-2021,Period 1
Jan-16-2021,Feb-25-2021,Period 2
];

Inner Join

IntervalMatch(InvoiceDate)
Load StartDate, EndDate
Resident Table;

 

Output:

AshutoshBhumkar_0-1638599516116.png

Hope this helps..

Thanks,

Ashutosh