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: 
n1ef5ng1
Creator
Creator

What does this code mean

=if( MonthEnd ( MAX( Date ) ) <> var_EndDate AND MonthEnd( MAX ( Date ) )
= MonthEnd( var_EndDate ) ,
Sum( IF(Derived_Status <> 'LRSHP', TEU,0)) / Day( var_EndDate ) * Day(MonthEnd( MAX ( Date ) )) ,
sum( IF(Derived_Status <> 'LRSHP', TEU,0) ))


This code above is trying to compute the latest month data to be EXTRAPOLATED with a certain formula, else it will just display the value. However the value that it compute have only one condition which is Derived Status <> LRSHP

However, I would like to reuse this code and use to compute the sum with three condition as pasted below, I tried to use

=if( MonthEnd ( MAX( Date ) ) <> var_EndDate AND MonthEnd( MAX ( Date ) )

= MonthEnd( var_EndDate ) ,

Sum( IF(Derived_Status = TSHIP and Container_Class_Name = Empty and Unlocode_Port_Of_Loading = 'ID*', TEU,0)) / Day( var_EndDate ) * Day(MonthEnd( MAX ( Date ) )) ,

Sum( IF(Derived_Status = TSHIP and Container_Class_Name = Empty and Unlocode_Port_Of_Loading = 'ID*', TEU,0))

but no value was compute.

any help in this

1 Reply
Not applicable

Few errors in ur expression;

1) use ' ' : Derived_Status = 'TSHIP' and Container_Class_Name = 'Empty'

2) use wildmatch:
wildmatch(Unlocode_Port_Of_Loading, 'ID*')

3) missing ) at the end :

so correct expression:

=if( MonthEnd ( MAX( Date ) ) <> var_EndDate AND MonthEnd( MAX ( Date ) )

= MonthEnd( var_EndDate ) ,

Sum( IF(Derived_Status = 'TSHIP' and Container_Class_Name = 'Empty' and wildmatch(Unlocode_Port_Of_Loading, 'ID*'), TEU,0)) / Day( var_EndDate ) * Day(MonthEnd( MAX ( Date ) )) ,

Sum( IF(Derived_Status = 'TSHIP' and Container_Class_Name = 'Empty' and wildmatch(Unlocode_Port_Of_Loading, 'ID*'), TEU,0)))