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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
anindya_manna
Creator II
Creator II

How to compare two different field in set expression?

Hello Experts,

I have a table like below.

   

Process DateCAMPAIGN_START_DATESalesAgent ID
1/1/20182/1/2015 12:00:00 AM500111
1/2/20185/1/2015 12:00:00 AM600222
1/3/20185/13/2015 12:00:00 AM700333
1/4/20185/21/2015 12:00:00 AM800444
1/5/20185/29/2015 12:00:00 AM900555
1/6/20186/2/2015 12:00:00 AM1000666
1/7/20186/3/2015 12:00:00 AM1100777
1/8/20186/9/2015 12:00:00 AM1200888
1/9/20186/18/2015 12:00:00 AM1300999

Below code not working for me.

avg({$<[Process Date]=P({">=$(=addmonths(Max(CAMPAIGN_START_DATE),-6)) <=$(=date(Max(CAMPAIGN_START_DATE),'MM/DD/YYYY'))"})>}[Sales Amt])

I think two different field cant be compare in set exp.So please suggest any alternative idea inclding IF condition.

I dont have access to the script part so cant create any additional flag

10 Replies
anindya_manna
Creator II
Creator II
Author

avg({$<[Process Date]={">=$(=date(addmonths(CAMPAIGN_START_DATE,-6),'MM/DD/YYYY')) <$(=date(CAMPAIGN_START_DATE,'MM/DD/YYYY'))"}>}[Sales Amt])