Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Avg Days to Pay

I am trying to find syntax to write a few statements.

Avg Days to Bill: The syntax in SQL is DATEDIFF(dd,dc.service_date,dc.bill_date).  I have seen a FLOOR(column-column) but i'm not sure that is the correct way when converting syntax.

IF Condition: The syntax in SQL is  CASE WHEN "status" = 'Cancelled', THEN  ""status"" ELSE 0 END AS "Cancelled Cases"

Is there something in Qlik Sense that can replace these?

Thanks

1 Solution

Accepted Solutions
shraddha_g
Partner - Master III
Partner - Master III

Try,

date(floor(service_date))-date(floor(billed_date))

This would give you difference in number of days between these dates.

View solution in original post

3 Replies
isaaclin
Contributor III
Contributor III

For if condition, try

IF("status" = 'Cancelled', 'status','0') as Cancelled_Cases

I don't really understand your first question, could you specify it again?

Anonymous
Not applicable
Author

‌Thanks for the reply. I'll try that IF on Monday when I get back to the office and comment back then.

THe the first question  basically I'm looking for the Qlik syntax for a datediff calculation. service date minus billed date would give me the number of days it took for a bill to go our the door.  I am currently using the floor function ( FLOOR(service_date,billed_date) ). I am just not positive that it's the appropriate way to get a date difference between the two fields.

shraddha_g
Partner - Master III
Partner - Master III

Try,

date(floor(service_date))-date(floor(billed_date))

This would give you difference in number of days between these dates.