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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
wmarkett1983
Contributor II
Contributor II

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

Hi,
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')

wmarkett1983_1-1669899926138.png

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