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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
rittermd
Master
Master

Expression Help

I am trying to replicate an existing report created by a SQL stored procedure.

The field AvoidableDays is defined as INT in the stored procedure.  As a result the decimal values of the data are ignored when summing. 

For example the raw data might calculate as  4  & 5.7 for Avoidable Days for 2 rows.

The stored procedure is showing the sum of these as 9.  Qlik however is showing the sum as 10.

Here is the expression I have in my script to calculate this.

If (("LENGTH_OF_STAY"-"GMLOS")>0,("LENGTH_OF_STAY"-"GMLOS"),0) as AvoidableDays,

My expression is the same as the stored procedure.  But Qlik is treating the raw data differently than SQL. 

How can I modify the expression in Qlik to drop the decimals and do what the Stored Procedure is doing?

I need to have my numbers in Qlik match what they are currently seeing.  Even if it is wrong.

Hopefully this makes sense.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Check for Floor() and Ceil() functions

View solution in original post

1 Reply
MK_QSL
MVP
MVP

Check for Floor() and Ceil() functions