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

Problem in YTD Calculation

Dear All,

I have a basic query. In my QVW document there are data for Actual and P&B. P&B figures are there for all the 12 months. Actual data are there for the months up to the last month. For example, if current month is December, then Actual Data will be up to November, month wise, where as P&B Data are there for all 12 Months up to March. I want to do YTD Calculation. I am able to do that for Actual since all the data will have to be processed. But in case of P&B, the data up to November only needs to be processed ignoring the current month data.

I am trying to write script for YTD and for this I am using YeartoDate function. It is not helping me as December data is also taken into consideration, where as my requirement is to ignore the December data for that purpose.

How can I achieve this ? 

2 Replies
Not applicable

Hi Try This

=sum({<DateField={'>=$(Vstartyear)<=$(vMaxDate)'}>}Sales)

Variables:

Vstartyear=Date(YearStart(vMaxDate),'DD/MM/YYYY')

vMaxDate=Date(max(DateField),'DD/MM/YYYY')

Not applicable

Hi Manish,

YTD Calculation is correct which posted by nirmal

but only one thing you can do is at the time of reload the data of P&B

you can restrict the data is " Today-1".

Ananth