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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

Future Date Calculation using Set Analysis

In the attached App, if you select FY16, you will see in GRAPH A: FY Estimate to Complete: $0

The expression is: if(GetSelectedCount(FISCAL_YEAR)=0 ,0, round(Sum({1<FCST_DATE = {"$(=date(max(FCST_DATE), 'MM-DD-YYYY'))"}>}FCST_AMT),1000)/1000)

If FY17 is selected, that number is 0 but it should be $40k.

What am I missing?

14 Replies
sunny_talwar

What is the expected output for the table? with and without selection?

cbaqir
Specialist II
Specialist II
Author

The Lifetime Expressions should not change even if a Fiscal Year selection is made. The numbers should always read:

Lifetime Actuals: $881

Lifetime Estimate to Complete: $40

Lifetime Estimate at Completion: $921

Lifetime Funding: $0

Lifetime Variance to Funding: ($921)

The FY expressions should change based on Fiscal Year Selections. All FY numbers should be blank if one FY is not selected.

FY17:

FY Actuals: $0

FY Estimate to Complete: $40

FY Estimate At Completion: $40

FY Budget: $284

FY Variance to Budget: $244

FY16:

FY Actuals: $200

FY Estimate to Complete: $00

FY Estimate At Completion: $00

FY Budget: $284

FY Variance to Budget: $84

FY15:

FY Actuals: $325

FY Estimate to Complete: $00

FY Estimate At Completion: $325

FY Budget: $284

FY Variance to Budget: ($41)

FY14:

FY Actuals: $356

FY Estimate to Complete: $00

FY Estimate At Completion: $356

FY Budget: $284

FY Variance to Budget: ($72)

sunny_talwar

I think one of your field name changed from FCST_AMT to fcST_AMT. Seems to be working now after the name is changed appropriately in the expressions.

cbaqir
Specialist II
Specialist II
Author

Ok, that issue aside, this calc needs to be specific for selected REQUEST_ID. The sample doesn't include this because I only pulled one REQUEST_ID.

=If(Max({<IS_CUR_FCST = {'y'}>}APP_DATE) < Max({1<IS_CUR_FCST = {'y'}>}FCST_DATE)+1, 0, Round(Sum({1<FCST_DATE = {"$(=Date(Max({<IS_CUR_FCST = {'y'}>}FCST_DATE), 'MM-DD-YYYY'))"}, IS_CUR_FCST = {'y'}>}FCST_AMT), 1000)/1000)

Something like... 1-$ maybe?

Round(Sum({1-$<FCST_DATE = {"$(=Date(Max({<IS_CUR_FCST = {'y'}>}FCST_DATE), 'MM-DD-YYYY'))"}, IS_CUR_FCST = {'y'}>}FCST_AMT), 1000)/1000)

sunny_talwar

More like this:

Round(Sum({1<FCST_DATE = {"$(=Date(Max({<IS_CUR_FCST = {'y'}>}FCST_DATE), 'MM-DD-YYYY'))"}, IS_CUR_FCST = {'y'}, REQUEST_ID = $::REQUEST_ID>} FCST_AMT), 1000)/1000)