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: 
Not applicable

Replacing Before() function

Hello guys, is there any other function to use which applies the same function as Before() function but will not display null value?

4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In the before function, use an expression (like RangeSum) that does not return null values. Like:

=before(RangeSum(Sales))

-Rob

Not applicable
Author

It dont work. Take a look at my code?

=if( Before( Sum (IF(Status <> 'SINGLE' and GUYS>=0, GUYS,0)) , 0)  = 0

  OR IsNull( Before( Sum (IF(Status <> 'SINGLE' and GUYS>=0, GUYS,0)) , 0)) = -1, null(),

if( MonthLast( MAX( Date ) ) <> var_LastDate AND MonthLast( MAX ( Date ) )

= MonthLast( var_LastDate ) ,

                Sum( IF(Status = 'ATTACHED', GUYS,0)) / Day( var_LastDate ) * Day(MonthLast( MAX ( Date ) )) ,

                Sum( IF(Status = 'ATTACHED', GUYS,0) ))

                - Before(Sum(IF(Status = 'ATTACHED',GUYS,0)) , 1 )

                )

Kushal_Chawda

ty this,

f( Before( Sum (IF(Status <> 'SINGLE' and GUYS>=0, GUYS,0)) , 0)  = 0

  OR IsNull( Before( Sum (IF(Status <> 'SINGLE' and GUYS>=0, GUYS,0)) , 0)) = -1, 0,

if( MonthLast( MAX( Date ) ) <> var_LastDate AND MonthLast( MAX ( Date ) )

= MonthLast( var_LastDate ) ,

                rangesum(Sum( IF(Status = 'ATTACHED', GUYS,0)) / Day( var_LastDate ) * Day(MonthLast( MAX ( Date ) ))) ,

                rangesum(Sum( IF(Status = 'ATTACHED', GUYS,0) ))

                - Before(Sum(IF(Status = 'ATTACHED',GUYS,0)) , 1 ))

                )

Not applicable
Author

It still give me null value 😐