Skip to main content
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

Count Contracts per period over all Data based on contract start/end date

I would like to count the number of contracts that are active in each month.

NumberOfActiveContracts =
Count(TOTAL DISTINCT {$<SV_WARTUNG_VONLAUFZEIT={"<=$($(vMaxLinkCalendar))"},SV_WARTUNG_BISLAUFZEIT2={">=$($(vMinLinkCalendar))"}>} WE_Fabriknummer)

MinDate = $(vMinLinkCalendar)

MaxDate = $(vMaxLinkCalendar)
vMinLinkCalendar =Date(MIN(if(LINK_CALENDAR<'01.12.2020','01.12.2020',LINK_CALENDAR)),'DD.MM.YYYY')

vMaxLinkCalendar = Date(MAX(LINK_CALENDAR),'DD.MM.YYYY')


The expression NumberOfActiveContracts gives for each Month(Monat) the same values, because the variables vMinLinkCalender or vMaxLinkCalender are executed with "TOTAL" and not only for the Month-Dimension. How can I achieve this?

Ist ist possible to execute an expression/variable without TOTAL in an expression with TOTAL?
I tried to use the column values MinDate/MaxDate in the set analysis, but that does not work.

Labels (1)
0 Replies