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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Karim_Khan
Creator III
Creator III

YTD calulation

Hi Team,

    I want YTD calculation on the basis of Monthly selection

KK
Labels (1)
23 Replies
MK_QSL
MVP
MVP

You can... What is the format of your month?

Can you able to provide sample data or sample application?

Check enclosed sample file.

Karim_Khan
Creator III
Creator III
Author

Cisco_Tool:

LOAD [End Customer Global Ultimate Name],

     Country,

     [End Customer HQ Top],

     [Sales Level 1],

     [Sales Level 2],

     [Sales Level 3],

     [Sales Level 4],

     [Sales Level 5],

     [Partner Name],

     [Fiscal Period ID],

     left([Fiscal Period ID],4) as Year,

     Right([Fiscal Period ID],2) as Month,

     FMV,

     [Net Bookings],

     Group

FROM

[\\arlmssan02\cm$\tp_managers\DBMIGrp\9. Team Members Folders\Karim\Assign_Project\Nikhil.G\CISCO\Copy of June raw.xlsx]

(ooxml, embedded labels, table is Sheet1);

Fiscal_Calender:

LOAD [Fiscal Period ID],

     [Fiscal Month],

     [Calender Month],

     Quarter

FROM

\\india.eclerx.com\ctrxdata\ARLM_R_DATA\Karim.Khan\Desktop\Fiscal_Calender.xlsx

(ooxml, embedded labels, table is Sheet1);

I am applying above script.

My expression for calcultaing YTD is as below

=sum({<Year={2015},Month={" >= $(vMinMonth) <= $(vMaxMonth)"},Month={'<=$(vFiscalNum)'}>}[Net Bookings])

KK
MK_QSL
MVP
MVP

Check my sample file enclosed in first reply.

Karim_Khan
Creator III
Creator III
Author

In this I am able to show the YTD for selected month But I want sum of Month data.

In your Sample file.

Jan -150

Feb -250

Mar -350


But I want sum of Month e.g


If Feb will select then it should show 400 instead of 250

and Mar will select then it should show 750 instead of 350

KK
MK_QSL
MVP
MVP

Change Expression as below

=SUM({<Month = , Year =, Date = {">=$(=YearStart(MonthEnd(MakeDate(Max(Year),Max(Month)))))<=$(=MonthEnd(MakeDate(Max(Year),Max(Month))))"}>}Sales)

Karim_Khan
Creator III
Creator III
Author

But Sir I don't have Date Field

KK
qlikviewwizard
Master II
Master II

Without date field how can you achieve YTD? It is not possible.

Karim_Khan
Creator III
Creator III
Author

It is Possible without date also.In one of my earlier qvd its working fine but other calculation is getting impacted so I am creating the new one which will show entire calculation correctly

KK
MK_QSL
MVP
MVP

Check enclosed file...