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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
jcampbell474
Creator III
Creator III

Set Analysis adding records to dimension

I'm working on a app that uses set analysis to tell me how many times a telephone number called on each previous selected day.  I thought that it would only look for records in the dimension, but if a telephone called on the day before, it adds that record in the dimension.  I need to get the set analysis to look back to the base day (dimension), but now I'm thinking aggr might be needed.

Here's my expression.  I have 30 of them.  -1, -2, -3, and the further I go back, the more telephone numbers are added.

sum({<datekey={"$(=Date(vdatekey - 1))"}>}Ct)

I've searched and can't find a way to implement it.  Can anyone tell me what I'm doing wrong or if I'm taking the wrong approach?

fcrv2a.PNG

fcrv2b.PNG

10 Replies
jcampbell474
Creator III
Creator III
Author

Thanks.  Tweaked it a little more.  Here's the final result:

if(aggr(only({<datekey={"$(=Date(vdatekey))"}>}TelephoneNum),TelephoneNum) =

  aggr(only({<datekey={"$(=Date(vdatekey - 1))"}>}TelephoneNum),TelephoneNum) or

  aggr(only({<datekey={"$(=Date(vdatekey))"}>}TelephoneNum),cName) =

  aggr(only({<datekey={"$(=Date(vdatekey - 1))"}>}TelephoneNum),cName),

  sum({<datekey={"$(=Date(vdatekey - 1))"}>}Ct),0)