Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

DateMonth

Hi All

I have the master calendar which works perfectly

I just want to know how do we get the date like this

14-Jan

15-jan

.

.

.

.

.

30-dec   now iam geting only month but ther is no date prefix to it

thanks

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

FiscalCalendar:

LOAD

*,

Dual('Q' & Ceil(FiscalMonth/3), Ceil(FiscalMonth/3)) AS FiscalQuarter, // Fiscal Calendar Quarter

Dual(Text(Date(MonthEnd(Date), 'MMM')), FiscalMonth) AS FiscalMonthName; // Fiscal Calendar Month Name

LOAD

*,

Year(Date) AS Year, // Standard Calendar Year

Month(Date) AS Month, // Standard Calendar Month

week(Date) As Week,

//Date(Date ,'DD-MMM') as DateMonth,

if(WeekDay(Date) = 'Mon' or Floor(Date) = Floor(Monthstart(Date)) or Floor(Date) = Floor(Monthend(Date)),Date(Date,'DD-MMM')) as DateMonth,

Date(MonthEnd(Date), 'MMM') AS MonthName,  // Standard Calendar Month Name

//Dual('Q' & Ceil(Month(Date)/3), Ceil(Month(Date)/3)) AS Quarter,  // Standard Calendar Quarter

'Q' & Ceil(Month(Date)/3) & '-' & Year(Date) as Quarter,

Mod(Month(Date) - $(vFiscalYearStartMonth), 12)+1 AS FiscalMonth,  // Fiscal  Month

Right(YearName(Date,0,$(vFiscalYearStartMonth)),4)as FiscalYear,

date(MonthStart(Date),'MMM-YY') AS MonthYear,

YearName(Date, 0, $(vFiscalYearStartMonth)) AS FiscalYearr;  // Fiscal Year

LOAD

Date($(vStartDate) + RangeSum(Peek('RowNum'), 1) - 1) AS Date,

RangeSum(Peek('RowNum'), 1) AS RowNum

AutoGenerate vEndDate - vStartDate + 1;

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

15 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can use the date function like below.

Date(DateField ,'DD-MMM') as DateMonth

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Chanty4u
MVP
MVP

create datemonth field as

Month(Datefield,'DD-MMM') as DateMonth

Kushal_Chawda

Do you have Date field in your data?

smilingjohn
Specialist
Specialist
Author

It works but the DateMonth field is showing all the date right from 1 to 30

I want it to display one weeks date for example like

14-Nov

21-Nov

28-Nov

.

.

.and so on

That is the begining of the week datmonth

Kushal_Chawda

try this

date(Weekstart(DateField),'DD-MMM') as DateMonth

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this,

Weekname(Datefield) As week

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
smilingjohn
Specialist
Specialist
Author

How to get the Only date month field for mondays ? (Starting from the first day of the week)

For example

like this snap shot DateMOnth.PNG

THanks

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

If you just need for Monday then you can try this.

Load if(WeekDay(Date)  = 'Mon',Date(Field,'DD-MMM')) as New Date

From xyz.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
smilingjohn
Specialist
Specialist
Author

Hi Kasuhi

I have the master Calendar already please look into the below script , out of my date field i want to get this DateMonth

MaxMin:

LOAD Max(Date) as MaxDate,

  Min(Date) as MinDate

Resident FluData;

SET vFiscalYearStartMonth = 4;

let vStartDate=Peek('MinDate');

let vEndDate=Peek('MaxDate');

FiscalCalendar:

LOAD

*,

Dual('Q' & Ceil(FiscalMonth/3), Ceil(FiscalMonth/3)) AS FiscalQuarter, // Fiscal Calendar Quarter

Dual(Text(Date(MonthEnd(Date), 'MMM')), FiscalMonth) AS FiscalMonthName; // Fiscal Calendar Month Name

LOAD

*,

Year(Date) AS Year, // Standard Calendar Year

Month(Date) AS Month, // Standard Calendar Month

week(Date) As Week,

Date(Date ,'DD-MMM') as DateMonth,

Date(MonthEnd(Date), 'MMM') AS MonthName,  // Standard Calendar Month Name

//Dual('Q' & Ceil(Month(Date)/3), Ceil(Month(Date)/3)) AS Quarter,  // Standard Calendar Quarter

'Q' & Ceil(Month(Date)/3) & '-' & Year(Date) as Quarter,

Mod(Month(Date) - $(vFiscalYearStartMonth), 12)+1 AS FiscalMonth,  // Fiscal  Month

Right(YearName(Date,0,$(vFiscalYearStartMonth)),4)as FiscalYear,

date(MonthStart(Date),'MMM-YY') AS MonthYear,

YearName(Date, 0, $(vFiscalYearStartMonth)) AS FiscalYearr;  // Fiscal Year

LOAD

Date($(vStartDate) + RangeSum(Peek('RowNum'), 1) - 1) AS Date,

RangeSum(Peek('RowNum'), 1) AS RowNum

AutoGenerate vEndDate - vStartDate + 1;