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

YTD & LY YTD

Hello,

On my sheet the user can select a year and a single month. The idea is that a then display a dashboard with the Current YTD and the LastYear YTD.

But how could i do that, my data is stored on a daily base, but i have no idea on how to sence wich month has been selected ....

Kind Regards, Harry

13 Replies
RicardoRamos
Employee
Employee

Hi there,

here is my idea:

create one field with the year;

create one field with the month;

create one variable with the max year;

create one variable with the max month;

to obtain the YTD you make something like (please check the syntax): sum({<Year={vMaxYear}, Month={"<MaxMonth"}>})

to obtain the LYTD you make something like (please check the syntax): sum({<Year={vMaxYear-1}, Month={"<MaxMonth"}>})

every time you select an year and a month the variables will adjust.

I hope that this works with you.

Not applicable
Author

I'm working with 2 solutions and would like to monitor their speed.

But for the second solution i'm having problems with getting the value

SUM

({$<DAT_YEAR={Dash_SelYear}>}DSH_TICKETS)

Result into 0, but the same with just Dash_SelYear replaced by 2008 works.

In another textbox i'm displayed Dsh_SelYear*2, and i'm getting 4016, so that seems to work .....





Not applicable
Author

I've replaced it with an if and that works, but if anyone could help me out why the filterexpressions isn't workign with a variable, feel free.

Not applicable
Author

({$<DAT_YEAR={$(#Dash_SelYear)}>}DSH_TICKETS)

Did you try this ?

Philippe