Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cyclic Groups and if statement

Hello,

I'm trying to create a line showing my 'actual pass rate' and my 'forecast pass rate' in one expression based on how many orders I have in the system. I have a cyclic group where the user can switch between the 'Planned Delivery' date and the 'Promised Delivery Date', but I want the line to show where the cyclic group is less than today. Currently I have:

=IF(GetCurrentField([PD/PDD]) < MonthStart(Today()),

(SUM(_DELIVERED_ONTIME)/SUM(_OVERALL_DELIVERIES))*100, ((SUM(_DELIVERED_ONTIME) + SUM(_FORECAST_DELIVERIES))/SUM(_OVERALL_DELIVERIES)*100)

The issue is that it is only showing the 'actual pass rate' indicating that something is wrong with the if statement.

Can anyone see where the issue is?

Kind Regards

Andrew

1 Solution

Accepted Solutions
Gysbert_Wassenaar

GetCurrentField([PD/PDD]) simply returns the field name, not the value of the field. Perhaps this works:

=IF( $(='[' & GetCurrentField([PD/PDD]) & ']') < MonthStart(Today()),

(SUM(_DELIVERED_ONTIME)/SUM(_OVERALL_DELIVERIES))*100, ((SUM(_DELIVERED_ONTIME) + SUM(_FORECAST_DELIVERIES))/SUM(_OVERALL_DELIVERIES)*100)


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

GetCurrentField([PD/PDD]) simply returns the field name, not the value of the field. Perhaps this works:

=IF( $(='[' & GetCurrentField([PD/PDD]) & ']') < MonthStart(Today()),

(SUM(_DELIVERED_ONTIME)/SUM(_OVERALL_DELIVERIES))*100, ((SUM(_DELIVERED_ONTIME) + SUM(_FORECAST_DELIVERIES))/SUM(_OVERALL_DELIVERIES)*100)


talk is cheap, supply exceeds demand
sunny_talwar

I doubt that your column names are actual dates. GetCurrentField([PD/PDD]) outputs a column header. I think you are trying to do something else, try this maybe:


=IF(GetCurrentField([PD/PDD]) = 'Planned Delivery',


(SUM({<[Planned Delivery] = {"<=$(=MonthStart(Today()))"}>}_DELIVERED_ONTIME)/SUM({<[Planned Delivery] = {"<=$(=MonthStart(Today()))"}>}_OVERALL_DELIVERIES))*100,


((SUM({<[Promised Delivery Date] = {"<=$(=MonthStart(Today()))"}>}_DELIVERED_ONTIME) + SUM({<[Promised Delivery Date] = {"<=$(=MonthStart(Today()))"}>}_FORECAST_DELIVERIES))/SUM({<[Promised Delivery Date] = {"<=$(=MonthStart(Today()))"}>}_OVERALL_DELIVERIES)*100)