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: 
abhaysingh
Specialist II
Specialist II

logic Help

Hi ,

pls help me in this, need the year start date of as per fiscal year, when selecting the dates,

attaching sample file and data.

when user select 30.04.2016, year start shud be as per fiscal year  which is 01.04.2016

when user select 31.03.2016, year start shud be as per fiscal year  which is 01.04.2015

6 Replies
PrashantSangle

Hi,

Try,

YearName(DateField,0,,4)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
swuehl
MVP
MVP

Try as expression

=Yearstart(Min(Dates),0,4)

ajsjoshua
Specialist
Specialist

Hi,

SET vFiscalYearStartMonth = 4;

LET vStartDate = Num(YearStart(Today(), -1));

LET vEndDate = Num(YearEnd(Today()));

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

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

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

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

LOAD

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

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

AutoGenerate MaxDate- MinDate+ 1;

Load

    Min(FactDate) AS MinDate,

    Max(FactDate) AS MaxDate

RESIDENT FactTableName;

Anonymous
Not applicable

Will this work?

sunny_talwar

Just out of curiosity, how come most of your discussion thread are titled "Logic Help" abhay‌? Is it that difficult to come up with a decent title for your discussion threads

Capture.PNG

Try to be concise, but descriptive in your titles buddy. These titles are not helpful for people who might be having similar issues in the future because the title is vague and there are no tags.

Although you are getting decent responses to your questions, but I would still suggest that please spend a little time to give back to this community (who has helped you almost always) by doing a little extra hard work on your end

QlikCommunity Tip: How to get answers to your post?

Best,

Sunny

msdeepak
Contributor II
Contributor II

Sunny, maybe there is some science behind that? The word Logic may kind of  trigger a curiosity in the members to view and resolve it like a challenge. So I would concur there is a "logic" behind this approach

-Deepak