Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

dmelillo
Contributor III

Set Analysis Comparing Two Dates

Basically, I only want to SUM the $$ [Upsell ARR (converted)] if the Close Date of an Opp is > the start of a campaign. I feel like I have the right syntax below but it isnt working. Maybe I am overlooking something. Any help is appreciated.

Sum({<[Close Date] = {'>[Campaign Start Date]'}>}[Upsell ARR (converted)])

-dave

1 Solution

Accepted Solutions
Highlighted

Re: Set Analysis Comparing Two Dates

May be this:

Sum(If([Close Date] > [Campaign Start Date], [Upsell ARR (converted)]))

5 Replies
vishsaggi
Esteemed Contributor III

Re: Set Analysis Comparing Two Dates

Is your Close Date and Campaign Start Date, holds same date formatting?

Highlighted

Re: Set Analysis Comparing Two Dates

May be this:

Sum(If([Close Date] > [Campaign Start Date], [Upsell ARR (converted)]))

dmelillo
Contributor III

Re: Set Analysis Comparing Two Dates

This worked thank you Sunny

Re: Set Analysis Comparing Two Dates

A even better approach here would be to create a flag in the script

LOAD If([Close Date] > [Campaign Start Date], 1, 0) as Flag

and then this

Sum({<Flag = {1}>} [Upsell ARR (converted)])

dmelillo
Contributor III

Re: Set Analysis Comparing Two Dates

Campaign Start Date and Close Dates aren't static so they need to be calculated per user selections, but thank you for the tip!!!