Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

scaruthers
New Contributor

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
Honored Contributor III

Re: Avg Days to Pay

Try,

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

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

3 Replies
isaaclin
New Contributor III

Re: Avg Days to Pay

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?

scaruthers
New Contributor

Re: Avg Days to Pay

‌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
Honored Contributor III

Re: Avg Days to Pay

Try,

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

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

Community Browser