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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
marcel_olmo
Partner Ambassador
Partner Ambassador

Problems on YearToDate

Hi guys,

if I have a table like this :

CustomerMonthAmount
cust1ene1
cust1feb1
cust1mar1
cust2ene1
cust2feb1
cust2mar1
cust3ene1
cust3feb1
cust3mar1

I'd like to have a simple table with two expressions :

1- Total amount of sales.

2-YearToDate of amount of sales.

I've been trying to do it with a yeartodate set analysis I've found on the forum :

Year to Date = Sum({<Datefield={'>=$(=(Num(YearStart(Max(Datefield)))))<=$(=(Num(Datefield)))'}>}Sales)

And it works fine if no month is selected. But If I select, for example, february, I get this :

CustomerFebyearToDate
cust111
cust211
cust311

When the correct table is :

CustomerFebyearToDate
cust112
cust212
cust312

Any idea about how to solve that? I'm trying to avoid "alternate states". I hope it won't be necessary.

Many thanks in advance.

Regards, Marcel.

Labels (1)
0 Replies