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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

Flag for Beginning of Month

Hi Folks, 

i have the following situation: my data does look like:

MyDate:

01.11.2018

02.11.2018

03.11.2018

04.11.2018

08.09.2018

12.09.2018

My Question is, how can i identify the beginning of month, and if i can identify the beginning of month, how can i set the flag for only the beginning of month, my expected Output is:

 

MyDate:                      identify as                                        Flag

01.11.2018         Beginning of Month                              1

02.11.2018         Beginning of Month                              1

03.11.2018         Beginning of Month                              1

04.11.2018         Beginning of Month                              1

08.09.2018        2 Week                                                         2

12.09.2018        2 Week                                                         2

 

Does anybody have any idea, thanks a lot in advance

Beck

4 Replies
albert_guito
Creator II
Creator II

Try with monthstart() function

Ag+
Ag+
beck_bakytbek
Master
Master
Author

Hi Albert,

 

i tried with monthstart (), but i have Always: 01.11.2018, 01.12.2018. but how can i make visible that from 01 until 04 are always MonthStart(), i hope, i explained well 

albert_guito
Creator II
Creator II

Try using this field in your load statment:

IF(Week(MyDate)-Week(MonthStart(MyDate))=0,1,2) as Flag

Ag+

Ag+
beck_bakytbek
Master
Master
Author

Hi Albert,

 

first of all thanks a lot for your Suggestion, i have a Question: on the base of your calculation: 1 or 2 is Beginning of month?

 

Thanks a lot