You need to change your Set Analysis from
Further, I would approach the problem slightly differently. I would populate the source data so that you have prices for all days, see How to populate a sparsely populated field
How to do this when you have two keys (Id and Jour) is described in Generating Missing Data In QlikView.
Tks for your solution, it works.
I can't generate missing data because if a data is missing, it is because the product does not exist. Products can appear and disappear each day. That's why i want to take into the average only common products on two dates ranges.
Your solution works on one date. What about on a range of dates ? Imagine i want to set into a global variable the comparison date. I want to compute and compare the sum/count on one week before and one week after, always on common products. How can i do this ?
Thanks again for your time.
Do you really need to code this? Wouldn't it be a solution that the user just makes a selection in the Jour field?
If you want to code it, you could use two variables displayed in an Input box: MinDate and MaxDate. These could then be used in a Set Analysis expression: