Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Qlik Connect 2025! Where innovative solutions turn your data visions into reality: REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

inyeartodate

Hi i try to make an xy diagram with long and short term movement from budget

(X)

=(Sum(if(InMonth(Datum,Today(),0-vMonth),$(Volume)))

/

Sum(if(InMonth(Datum,Today(),0-vMonth),$(vBudgetVolym))))-1

(Y)

=(Sum(if(InYearToDate(Datum,Today(),0,4),$(Volume)))

/

Sum(if(InYearToDate(Datum,Today(),0,4),$(vBudgetVolym))))-1

i have implemented a button that change month vmonth in the X axis but i cant make it to work in the Y axis

if vmonth=-2 i want inyeartodate to be untill 2 month ago.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe like

=InYearToDate(Datum, RangeMin(Today(), Monthend(Today(),vmonth)),0,4)

View solution in original post

6 Replies
swuehl
MVP
MVP

Could you post a small sample QVW and describe a bit more detailed what the issue is (or where the result deviates from your expectation)?

Not applicable
Author

Hi, the result deviates from my expectations in (Y) then i change vmonth

i have tried this but no change in the result

=(Sum(if(InYearToDate(Datum,Today(),0,4)-vMonth,$(Volume)))

/

Sum(if(InYearToDate(Datum,Today(),0,4)-vMonth,$(vBudgetVolym))))-1

its like InYearToDate cant be changed

swuehl
MVP
MVP

InYearToDate() returns a boolean flag (FALSE / TRUE or 0/-1), then you subtract your variable vMonth from the returned boolean value, is this what you want?

Not applicable
Author

yes/no

i want to lower the range from InYearToDate(Datum,Today(),0,4) =20160401-20160816 today

into

20160401-20160731 vmonth=-1

20160401-20160630 vmonth=-2

20160401-20160531 vmonth=-3

swuehl
MVP
MVP

Maybe like

=InYearToDate(Datum, RangeMin(Today(), Monthend(Today(),vmonth)),0,4)

Not applicable
Author

thank you