Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
coleturegroup
Contributor III
Contributor III

Create a flag during the load of all start-dates ('MM/DD/YYYY') in groups of two weeks each?

I have a series of records with date fields ('MM/DD/YYYY'), and during the load process i would like to set two flags:

1_Week_flag  and  2_Week_flag:

that groups the dates in two buckets from the current week start. The daily load will refresh the flags as the weeks roll forward.

Then use the flag in a set analysis statement to show one or two weeks of data in a bar-chart.

Any Ideas are appreciated

 

Labels (1)
1 Solution

Accepted Solutions
Or
MVP
MVP

if(inweek(startdate,today(),0) or inweek(startdate, today(),1),1) as next_week_flag, perhaps?

View solution in original post

4 Replies
ManuelRühl
Partner - Specialist
Partner - Specialist

Hi,

there is a function "inweek()" you could use to flag the records.

inweek - Skript- und Diagrammfunktion | Qlik Sense unter Windows Hilfe

Manuel Rühl
coleturegroup
Contributor III
Contributor III
Author

Yes I saw the inweek function only works for reading the current week or the next week.

inweek(startdate, today(),0) as current_week_flag;

inweek(startdate, today(),1) as next_week_flag;

I need to have it pull the current and next week in one bucket not separate flags?

Or
MVP
MVP

if(inweek(startdate,today(),0) or inweek(startdate, today(),1),1) as next_week_flag, perhaps?

coleturegroup
Contributor III
Contributor III
Author

Perfect Thank you