Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for
Did you mean:
Not applicable

## Group by

Good morning,

Who can help me with this problem i have.

For the calculation of the wault i use the next expression;

avg({\$<CAMRULE_HCHARGECODE = {4,5,23}>}

if(LEN(TRIM(TENANT_DTBREAK)) = 0 AND TENANT_DTBREAK > floor(now()) and CAMRULE_RENT_YEAR > 0,

(TENANT_DTBREAK - floor(now())) / 365.25 * CAMRULE_RENT_YEAR,

if(TENANT_DTEXPIRATION > floor(now()) and CAMRULE_RENT_YEAR > 0,

(TENANT_DTEXPIRATION - floor(now())) /365.25 * CAMRULE_RENT_YEAR)))

/ CAMRULE_RENT_YEAR

This calculation does exactly what i would expect it to do but it's per tenant and when i remove the dimension tenant to see the wault for the selected properties all results will be removed.

1 Solution

Accepted Solutions
MVP

May be this:

Sum(Aggr(

avg({\$<CAMRULE_HCHARGECODE = {4,5,23}>}

if(LEN(TRIM(TENANT_DTBREAK)) = 0 AND TENANT_DTBREAK > floor(now()) and CAMRULE_RENT_YEAR > 0,

(TENANT_DTBREAK - floor(now())) / 365.25 * CAMRULE_RENT_YEAR,

if(TENANT_DTEXPIRATION > floor(now()) and CAMRULE_RENT_YEAR > 0,

(TENANT_DTEXPIRATION - floor(now())) /365.25 * CAMRULE_RENT_YEAR)))

/ CAMRULE_RENT_YEAR,

tenant))

Replace Sum with whatever outer aggregation makes sense for your case.

4 Replies
MVP

May be this:

Sum(Aggr(

avg({\$<CAMRULE_HCHARGECODE = {4,5,23}>}

if(LEN(TRIM(TENANT_DTBREAK)) = 0 AND TENANT_DTBREAK > floor(now()) and CAMRULE_RENT_YEAR > 0,

(TENANT_DTBREAK - floor(now())) / 365.25 * CAMRULE_RENT_YEAR,

if(TENANT_DTEXPIRATION > floor(now()) and CAMRULE_RENT_YEAR > 0,

(TENANT_DTEXPIRATION - floor(now())) /365.25 * CAMRULE_RENT_YEAR)))

/ CAMRULE_RENT_YEAR,

tenant))

Replace Sum with whatever outer aggregation makes sense for your case.

Not applicable
Author

Hi there Sunny T,

Thanks for your comment. this should do the trick.

Master III