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

Sum with InYearToDate

Dear guys,

I'm not able to solve an issue related a sum with InYearToDate

Firstly, the data I use are included in the year I'm analyzing so the 2 expressions below should give me the same result :

1) sum(var)

2) sum(if(InYearToDate (InvoiceDate.......... ),var)

but looking to attached file u will see for both expression different result.

In case of 2) it duplicate the values. Using DISTINCT solve the example I've but create problem in other case where the dimension I've to use give back just one row.

I've created just a fast example, that I attach, of the issue I have in my production environment

Thanks for your helps

Sergio

5 Replies
Not applicable
Author

Dear All,

Does anyone have an idea about it ?!

Thanks for your help

Sergio

Not applicable
Author

I have used following set analysis expression which gives me same result.


sum({<"=$(year(InvoiceDate))"="=$(year('2010-05-17'))">} KZWI3)








Not applicable
Author

I have used following set analysis expression which gives me same result.


sum({<"=$(year(InvoiceDate))"="=$(year('2010-05-17'))">} KZWI3)








Not applicable
Author

I have used following set analysis expression which gives me same result.


sum({<"=$(year(InvoiceDate))"="=$(year('2010-05-17'))">} KZWI3)








Not applicable
Author

Dear Devang,

Thanks for your answer and it works in this case, but in my original report I've 2 column

One for this year Sales, the other one for year-1 Sales.

That's the reason why I used InYearToDate function that gives me 2010 sales till today, compare to 2009 sales till the same day of previous year.

How do I get the same using the Set Analysis ? 'Cause your selection above works fine just for the example, but If I had to use the same with 2 columns for different year I don't understand why InYearToDate function give me back data duplicated.

Thanks

Sergio