Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Partner
Partner

Re: reference a value from inside a calculated dimension

Yes I have tried, but It doesn't work. 
"

if(aggr(max(if(daysprincipal-pdsum>0.01,ReportDate-daysdate)),loan_app_id) <=30 ,$(vPrincipal),
if(aggr(max(if(daysprincipal-pdsum>0.01,ReportDate-daysdate)),loan_app_id) <=60, $(vPrincipal2),
if(aggr(max(if(daysprincipal-pdsum>0.01,ReportDate-daysdate)),loan_app_id) <= 90, $(vPrincipal3)),
if(aggr(max(if(daysprincipal-pdsum>0.01,ReportDate-daysdate)),loan_app_id)<= 180, $(vPrincipal4),
if(aggr(max(if(daysprincipal-pdsum>0.01,ReportDate-daysdate)),loan_app_id)<= 365, $(vPrincipal5), $(vPrincipal6)
          ))))

"

Highlighted
Partner
Partner

Re: reference a value from inside a calculated dimension

try this

Max(
if(aggr(max(if(daysprincipal-pdsum>0.01,ReportDate-daysdate)),loan_app_id) <=30 ,$(vPrincipal),
if(aggr(max(if(daysprincipal-pdsum>0.01,ReportDate-daysdate)),loan_app_id) <=60, $(vPrincipal2),
if(aggr(max(if(daysprincipal-pdsum>0.01,ReportDate-daysdate)),loan_app_id) <= 90, $(vPrincipal3)),
if(aggr(max(if(daysprincipal-pdsum>0.01,ReportDate-daysdate)),loan_app_id)<= 180, $(vPrincipal4),
if(aggr(max(if(daysprincipal-pdsum>0.01,ReportDate-daysdate)),loan_app_id)<= 365, $(vPrincipal5), $(vPrincipal6)
))))
)
Partner
Partner

Re: reference a value from inside a calculated dimension

The syntax is correct, but the returned values are still -, I keep thinking that there should be a way to reference the value inside.. but I guess there is not such a function in the userinterface... 
Screenshot_18.jpgScreenshot_19.jpg

Partner
Partner

Re: reference a value from inside a calculated dimension

I have manage to get it working with on my server.

You can refer back to measures by name or column() but not calculated dimension.

Another solution chould be to use a synthetic dimension but then it is not possible to use aggr()
Partner
Partner

Re: reference a value from inside a calculated dimension

Well, I have to use aggr, because for each loan_app_id, I have multiple daysdate, and thus i have to get the max out of these aggregated by each loan. 

And this fields must stay as a dimension in the table..

I have tried almost anything. 

I got it working in qlikview but the function I used there is not supported in Qlik Sense....

Thank you for your assistance, but i will still wait a few days maybe someone will come with an answer, or its not possible in this environment. 

My last resort is to have a field in the table with numbers (ex IndexField=1,2,3,4,5,6) and then reference this index field, but this will add a column, that my client doesn't want to see.. 

Partner
Partner

Re: reference a value from inside a calculated dimension

Hi @tomovangel

Have you solved this yet?

Br
Teis

Partner
Partner

Re: reference a value from inside a calculated dimension

No, 

I am thinking of using a field with numbers from 1 to 8, so it will always show the full calculated field, and then base the variables on this field.. but this is not a good way, because I will have 1 extra column with this index field... 

 

Partner
Partner

Re: reference a value from inside a calculated dimension

Could it be a solution using the index and condition all the measures on resault on the first field. Then in properties "add on" remove zero values?

Partner
Partner

Re: reference a value from inside a calculated dimension

I will look for a way, to display these variables based purely on the Aggregated' Dimension's values, until I have to publish this report, and If i don't find nothing until then i will just use index field....