Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
maoros
Contributor
Contributor

Incorrect expression using set analysis

Hi everyone,

I have a problem with a set analysis expression and I didn't identify which is the error.

Suppose we have the following data.

maoros_0-1594814266651.png

For the date 01/11/2019, I want to get the expect value equals to 0.

For 01/12/2019, Expected value = 0

For 01/01/2020, Expected value = 10

For 01/02/2020, Expected value = 11

For 01/03/2020, Expected value = 14

and so on.

That is,

maoros_1-1594814310137.png

However, I get 0's when I am using the following set analysis expression:
=Sum({< TheDate={">=$(=MonthStart(AddMonths(TheDate,-2)))<=$(=MonthEnd(AddMonths(TheDate,-2)))"} >} Actual)

But it is not correct because I get 0's and I didn't find which is my error.

maoros_2-1594814482914.png

Any ideas?

I include the qvw file used (ValueForSpecificDate.qvw).

I really appreciate your help.

--- maoh

 

1 Solution

Accepted Solutions
Kushal_Chawda

Probably you need this

=sum(aggr(above(sum({<TheDate>}Actual),2),TheDate))*avg(1)

View solution in original post

2 Replies
Kushal_Chawda

Probably you need this

=sum(aggr(above(sum({<TheDate>}Actual),2),TheDate))*avg(1)

maoros
Contributor
Contributor
Author

Thank you. It works!