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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

if to set analysis

Is there a way to convert this to set analysis?

if((ADate-90<=BDate), aggr(max(total <KEY> FieldC),KEY),0)





Labels (1)
7 Replies
Not applicable
Author

Hi,

Try something like this:

aggr(max({$<BDate = {'>= ADate-90'}>} total <KEY> FieldC), KEY)



Not applicable
Author

Hi there,

it should be something like this:

aggr(max({$<BDate={'>=$(ADate)-90'}>} total <KEY> FieldC),KEY)

Hope this helps

Regards!

Not applicable
Author

what if I change it to

sum(if(ADate-90<=BDate), aggr(max(total <KEY> FieldC),KEY),0)

Would i put the set after sum, aggr, or max?

Not applicable
Author

Oh I also have a variable which i have been using after the sum as $(variable)

thanks!!

Not applicable
Author

You have to put the set analysis inside sum and max.

can you give an example of how you use your variable?

Not applicable
Author

sum($(variable)aggr(max({$<BDate={'>=$(ADate)-90'}>} total <KEY> FieldC),KEY)

Here is my current expression, but if I change the 90 to 60 or 30 it does not do anything to the numbers I am getting. Is that due to my expression or most likely something else?

Not applicable
Author

I haven't prove it, but try:

sum($(variable) aggr(max({$<BDate={">=$(#=date(ADate-90)"}>} total <KEY> FieldC),KEY)


What is the value of the variable?