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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
fmazzarelli
Partner - Creator III
Partner - Creator III

case

Hi Community,

could you help me?

Wrong is the bold line.

SQL SELECT

GETDATE ()  AS "Data Giorno",

year("xlscad")*100+Month("xlscad") "Annomese",

case

when xlscad < ("Data Giorno" - 4 Month - 1 day)

      then 'SCADUTO DA OLTRE 120'

when xlscad between (current_date - 4 Month) and (current_date - 3 Month - 1 day)

      then 'SCADUTO DA 120'

WHEN xlscad between (current_date - 3 month) and (current_date - 2 Month - 1 day)

      then 'SCADUTO DA 90'

WHEN xlscad between (current date - 2 Month) and (current_date - 1 month - 1 day)

      then 'SCADUTO DA 60'

when xlscad between (current_date -1 month) and (current_date)

      then 'SCADUTO DA 30'

when xlscad between (current_date) and (current_date + 1 month)

      then 'A SCADERE A 30'

when xlscad between (current_date + 1 Month + 1 day) and (current_date + 2 month)

      then 'A SCADERE A 60'

when xlscad between (current_date + 2 month + 1 day) and (current_date + 3 month)

      then 'A SCADERE A 90'

when xlscad between (current_date + 3 month + 1 day) and (current_date + 4 month)

      then 'A SCADERE A 120'

when xlscad > (current_date + 4 month + 1 day)

      then 'A SCADERE OLTRE 120'

Else

'ZERO'

END

"SCAGLIONI"

11 Replies
fmazzarelli
Partner - Creator III
Partner - Creator III
Author

Hi Clever,

i'm out of office but your reply seems good.

I had already found a similar statement.

I'll test it this afternoon.

fmazzarelli
Partner - Creator III
Partner - Creator III
Author

OK it works.

Many thanks.