Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
skzwane01
Contributor III
Contributor III

Calculated Dimension not working / Error in Calculated dimension

Good day,

 

I am struggling with creating a calculated dimension.

I have an expression which works when done on textbox however when made a calculated dimension it does not work.

Please see below:

expression:

=if(Date(Date#((Effective_Month_Key), 'YYYYMM'), 'YYYYMM') - Date(Date#(Date(max(Last_Hire_Dte)), 'YYYY/MM/DD'), 'YYYYMM') >=90 and Staff_Type_Descr ='Temporary','Permanent',Staff_Type_Descr)

skzwane01_0-1594395050634.png

This works fine on the textbox.

 

When done as a calculated dimension it does not work. Please see below 

skzwane01_1-1594395209710.png

Please assist. How can I resolve ?

 

Kind Regards,

1 Solution

Accepted Solutions
Kushal_Chawda

you need aggr function to work your calculated dimension correctly

=aggr(if(Date(Date#((Effective_Month_Key), 'YYYYMM'), 'YYYYMM') - Date(Date#(Date(max(Last_Hire_Dte)), 'YYYY/MM/DD'), 'YYYYMM') >=90 and Staff_Type_Descr ='Temporary','Permanent',Staff_Type_Descr), Staff_Type_Descr)

View solution in original post

1 Reply
Kushal_Chawda

you need aggr function to work your calculated dimension correctly

=aggr(if(Date(Date#((Effective_Month_Key), 'YYYYMM'), 'YYYYMM') - Date(Date#(Date(max(Last_Hire_Dte)), 'YYYY/MM/DD'), 'YYYYMM') >=90 and Staff_Type_Descr ='Temporary','Permanent',Staff_Type_Descr), Staff_Type_Descr)