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

problem with inyeartodate function.

hi, well i'm new in qlikview, and i have a problem with the function inyeartodate, i need to obtain the sum of a range o dates, this part works well, in my qvw i have a selection of year and month  and a  table where i show this data, if i don't select a year, the function does what supose to do, but when i select a year, the column with de expresion of this function put all the values in 0, i don't know if i'm clear with my problem, but i hope that some one can help me.

pd. sorry for my english

3 Replies
gussfish
Creator II
Creator II

What are the dimensions of your table and what is the expression you're

using the function in? And how is your data structured?

Not applicable
Author

this is my expresion.

Sum(InYearToDate(InvoiceDate,SetDateYear(varMaxDate,$(=max(Year))),-1)*-1 * Amount)

varMaxDate is my top date so with setdateyear i try to chage de year of this date when i select a year but it doesn't work, my dimension is a group, includes client, county, salesperson, the table of sales invoice contains the primary key of the client and salesperson and this are related with the table clients and salespersons, the table of sales invoice is related with a master calendar where i have de dates that i select.

well this i think this is all.

Not applicable
Author

use this in your load statement:if (year2date(Date),1,nul()) as YTD and then in your expression YTD * Amount

at least if I understand your problem....