Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Prevent auto sum in KPIs

Hi,

I have created a time-series dataset for revenue from January to December by month. When I create a KPI for Revenue, I can have it show me the sum, avg, etc of revenue. Is there any way I can have it show revenue of the earliest date by default instead?

Thanks.

Tags (2)
1 Solution

Accepted Solutions
santhoo_san
Contributor II

Re: Prevent auto sum in KPIs

use set analysis within your expression

sum({<DateID={$(=max(DateID))>}Amount)

7 Replies
santhoo_san
Contributor II

Re: Prevent auto sum in KPIs

use set analysis within your expression

sum({<DateID={$(=max(DateID))>}Amount)

Re: Prevent auto sum in KPIs

use FirstSortedValue? If you have to pre-aggregate, use AGGR() by Date. Something like this maybe:

FirstSortedValue(

     AGGR(

          sum(Sales)

     , Date)

, Date)

Not applicable

Re: Prevent auto sum in KPIs

Hi all,

The issue is still not resolved. I have tried both methods but the KPI still shows the sum of the measure of all dates. I just want the KPI to show the measure of the earliest date.

Thank you for your help.

Allen

Not applicable

Re: Prevent auto sum in KPIs

Hi,

Can you share a sample of your app ?

Regards,

Xavier.

Re: Prevent auto sum in KPIs

Allen,

we are all trying to help, but you'll have to be more descriptive than this. It's not enough to say that it doesn't work. Please elaborate - what expressions have you tried, and what is your data structure. And, ideally - a sample app would be the best way for you to help us help you.

cheers,

Oleg

Not applicable

Re: Prevent auto sum in KPIs

Hi Oleg,

I've got it to work. Thank you all. The way it worked is Sum({$<Dates= {"$(=Max(Dates))"}>} Amount). Seems like only the quotes were missing

Employee
Employee

Re: Prevent auto sum in KPIs

Hi Allen,

What you want to do requires an expression in the object using Set Analysis, exactly what has been provided to you by our great community members. If you would like more information on Set Analysis  I suggest you watch these brief videos on the topic:

A Beginners' Introduction to Set Analysis (video)

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Regards,

Mike Tarallo

Qlik

Regards,
Mike Tarallo
Qlik
Community Browser