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: 
eloisateixeira
Contributor II
Contributor II

EXPRESSION WITH CONDITION

Hey qliker's, i need a help.

I want to make an expression with some conditions. I want the average number of days spent in a patient in hospitalization, before and after entering monitoring to make a comparison and see if there was an increase or decrease in the days of hospitalization.

For example:

Before: if DATE_HOPITALIZATION and DATE_DISCHARGE < (smaller than) DATE_MONITORING, show me the average of days in hospitalization (DATE_DISCHARGE - DATE_HOSPITALIZATION),

After: if DATE_HOPITALIZATION and DATE_DISCHARGE > (bigger than) DATE_MONITORING, show me the average of days in hospitalization (DATE_DISCHARGE - DATE_HOSPITALIZATION)

 

1 Solution

Accepted Solutions
Wlad_Masi
Former Employee
Former Employee

Hi @eloisateixeira,

This may work. 
Something to be aware of is when using the and in comparison you have to split it in two.
(If comparison or/and other comparison)


If(DATE_HOPITALIZATION < DATE_MONITORING AND DATE_DISCHARGE < DATE_MONITORING, sum(DATE_DISCHARGE - DATE_HOSPITALIZATION))

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.

View solution in original post

2 Replies
Wlad_Masi
Former Employee
Former Employee

Hi @eloisateixeira,

This may work. 
Something to be aware of is when using the and in comparison you have to split it in two.
(If comparison or/and other comparison)


If(DATE_HOPITALIZATION < DATE_MONITORING AND DATE_DISCHARGE < DATE_MONITORING, sum(DATE_DISCHARGE - DATE_HOSPITALIZATION))

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.
Kushal_Chawda
MVP
MVP

@eloisateixeira  Where you want to show this number? I mean which chart? What are the dimensions ?