Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead 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
sunny_talwar

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.

View solution in original post

4 Replies
sunny_talwar

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.

oknotsen
Master III
Master III

If your question is now answered, please flag the Correct Answer.

If not, please make clear what part of this topic you still need help with .

May you live in interesting times!
Not applicable
Author

Hello Onno,

Thank you for your comment, I've set the Correct Answer flag.