Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

How to set monthstart

Hi All,

@MayilVahanan @Taoufiq_Zarra 

I want to count the users   from particular date.

I have  Month filed    aug,sep,oct.     and users   

 

here my month start is from  25th to 25th..   

count(users)      for current month    25th oct to 25Nov..like for previous months also.. how can I set  monthstart from 25th ?

Labels (2)
1 Solution

Accepted Solutions
MayilVahanan

Hi @soniasweety 

Try like below for your scenario.

https://community.qlik.com/t5/QlikView-Scripting/Link-2-Date-Fields-in-1-Table-to-1-Master-Calendar/...

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

7 Replies
MayilVahanan

Hi @soniasweety 

Try like below.. Its one of the method

LET vMinDate = Floor(MakeDate(2020,1,1));
LET vMaxDate = Floor(Today());
LET vToday = $(vMaxDate);

TempCal:
LOAD
Date($(vMinDate) + RowNo() - 1) as TempDate
AUTOGENERATE
$(vMaxDate) - $(vMinDate) + 1;

MasterCalender:
Load
TempDate as Date,
Week(TempDate) as Week,
Year(TempDate) as Year,
if(Day(TempDate) <= 24, Month(TempDate), Month(AddMonths(TempDate,1))) as Month,
Month(TempDate) as OriginalMonth
Resident TempCal
Order By TempDate ASC;

Drop Table TempCal;

In front end,

Dim: Month 

Exp: Count(users)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
soniasweety
Master
Master
Author

thank you.

cant we handle in set analysis? 

MayilVahanan

Hi @soniasweety 

If you are using Month Field as Dimension, then set analysis will not work because month will start from 1st to 31st. But in your case, month need to start from 25th . So output won't come as expected.

Ex:

Month , Date, Count(users)
Jan, 1/1/2020, 10

..

Jan, 31/1/2020, 20

If you are using Month as Dim, then Jan will consider upto 31/1/2020.. Not upto 25th.

Hope it helps

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
soniasweety
Master
Master
Author

 @MayilVahanan 
thank you understood.  And working fine with your logic. 
but I have other date field  Date of training DOT    this is  considered as training completed date and completed month of it.

attached sample .. and expected output in text object.

soniasweety
Master
Master
Author

Hi @MayilVahanan  any suggestions ?

@tresesco 

MayilVahanan

Hi @soniasweety 

Try like below for your scenario.

https://community.qlik.com/t5/QlikView-Scripting/Link-2-Date-Fields-in-1-Table-to-1-Master-Calendar/...

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
soniasweety
Master
Master
Author

Thank you  @MayilVahanan  I will try and update you.