# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor III

## Calculate Totals per each Month based on Start and End date

Hello,

I am calculating a Length of Stay (LOS), for which I use 2 fields (start_date & end_date) and the following logic.

end_date - start_date = Length of Stay (LOS in days).

The following is an example of my table and results.

IDend_datestart_dateLOS
16/20/176/15/175
26/11/176/10/171
36/10/175/10/1730

What I need is to calculate the number of LOS days occurred in each month.  For example. ID 3, has an LOS 30 days, but in 20 of the days occurred in the month May and 10 days occurred in the month June.

I believe my end result should be a table like this

IDLOS MayLOS June
105
201
32010

Which would allow to me to calculate that the Total Patient Stay days in May = 20 and in June = 16.

I am not sure how to tackle this problem.

If anyone can help, that would be greatly appreciated.

Thank you,

Tags (2)
1 Solution

Accepted Solutions
Honored Contributor

## Re: Calculate Totals per each Month based on Start and End date

Hi,

May be as at attached file.

Regards,

Andrey

2 Replies
Honored Contributor

## Re: Calculate Totals per each Month based on Start and End date

Hi,

May be as at attached file.

Regards,

Andrey

New Contributor III

## Re: Calculate Totals per each Month based on Start and End date

Большое спасибо !!!