# Qlik Sense App Development

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Contributor II

## How can I use calculated dimension in set analysis?

Hi All,

In application I need show status it's not possible to create this field in the script, so I use calculated dimension.

Status:

IF(Aggr(\$(eAmountPS(vPeriod,SA)), Supplier)>Aggr(\$(eStretch_Goal_Per_Day(vPeriod)), Supplier), 'On Track',
IF(Aggr(\$(eAmountPS(vPeriod,MO))+\$(eAmountPS(vPeriod,SA)), Supplier)>Aggr(\$(eStretch_Goal_Per_Day(vPeriod)), Supplier),'Possible w/MO',  'At Risk'))

It works pretty good, but now I need to add KPI that should calculate another measure based on Status dimension and should show only Values with Status = 'On Track'

How can I do this?

Thanks,

Vitalii

Labels (2)

• ### Set Analysis

1 Solution

Accepted Solutions
Highlighted
MVP

## Re: How can I use calculated dimension in set analysis?

May bad, why don't you just do this

`Aggr(If(\$(eAmountPS(vPeriod,SA)) > \$(eStretch_Goal_Per_Day(vPeriod)), 'On Track'), Supplier)`
9 Replies
Highlighted
MVP

## Re: How can I use calculated dimension in set analysis?

How do you define your variable eAmountPS?
Highlighted
Contributor II

## Re: How can I use calculated dimension in set analysis?

eAmountPS:

Sum({<\$(\$1),\$(\$2)>[Extended Cost]})

Highlighted
MVP

## Re: How can I use calculated dimension in set analysis?

May bad, why don't you just do this

`Aggr(If(\$(eAmountPS(vPeriod,SA)) > \$(eStretch_Goal_Per_Day(vPeriod)), 'On Track'), Supplier)`
Highlighted
Contributor II

## Re: How can I use calculated dimension in set analysis?

Thank you for help!

It's better way, but I still want show Value with on track status in KPI.

This solution works fine as a dimension:

Aggr(If(\$(eAmountPS(vPeriod,SA)) > \$(eStretch_Goal_Per_Day(vPeriod)), 'On Track'), Supplier)

I tried do something like this in expression, but it doesn't show anything

Aggr(If(\$(eAmountPS(vPeriod,SA)) > \$(eStretch_Goal_Per_Day(vPeriod)), \$(eIncentiveValue(vPeriod))), Supplier)

Highlighted
MVP

## Re: How can I use calculated dimension in set analysis?

What exactly are you looking to see? Count of Suppliers which are on track?
Highlighted
Contributor II

## Re: How can I use calculated dimension in set analysis?

No, I want to know Incentive value for Status On Track

Highlighted
MVP

## Re: How can I use calculated dimension in set analysis?

May be try this

`Sum(Aggr(If(\$(eAmountPS(vPeriod,SA)) > \$(eStretch_Goal_Per_Day(vPeriod)), Sum([Incentive Value])), Supplier)`
Highlighted
Contributor II

## Re: How can I use calculated dimension in set analysis?

It doesn't work, but in any case thank you for your help.

Thanks,

Vitalii

Highlighted
MVP

## Re: How can I use calculated dimension in set analysis?

Sure, if you are able to share a sample, I am more than happy to take a look. Else, not sure what might be missing