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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Want YTD on selected date

Hello,

           i want YTD to be calculated on Selected date by user.

for example if user select date 15 feb 2009

user should get sales of from 1 jan 2009 to 15 feb 2009

how to do it?

thanks

Harlin

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

Hello

finally this worked

=Sum({$<Year = {$(=max(Year))}, Month={"<=$(=max({<Year={$(=max(Year))}>} Month))"},OrderDay={"<=$(=max(OrderDay))"}>} Value)

thanks Stefano for the response

my date is formated in M/D/YYY format.

thanks

Harleen Singh

View solution in original post

11 Replies
SunilChauhan
Champion II
Champion II

hope this help u

sum({<MonthYear={"=$(Max(MonthYear))"}<}Amount)

Sunil Chauhan
its_anandrjs
Champion III
Champion III

Hi,

Use YearStart( DateField )

Rgds

Anand

its_anandrjs
Champion III
Champion III

Hi,

Use some thing like

=If ( Date >= Yearstart(Today()) and  Date <= vTest , Date )

vTest = getfieldselections( Date )

Ex:-

vTest = 15 feb 2009

HTH

Rgds

Anand

Not applicable
Author

Any correct answer in terms of Set analysis??

thanks

Harlin

SunilChauhan
Champion II
Champion II

sum({<MonthYear={"=$(Max(MonthYear))"},{Date={"<=$(=Max(date))"}}<}Amount)

what about this sardar ji

Sunil Chauhan
Not applicable
Author

in your statement why are u using < in the last??

{Date={"<=$(=Max(date))"}}<}

thanks

harlin

Not applicable
Author

No all above not working.

Any working example??

thanks

Harlin

Not applicable
Author

Hi Harleen,

be careful if the date is numeric or formatted like dd/mm/yyyy.

This could be the problem.

Stefano.

Not applicable
Author

Look at this

I hope this helps u

Stefano