Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
TomBond77
Specialist
Specialist

Last value of a dimension

Hi experts

We need the last value of a dimension "Category", this one is on the last snapshot "YM", Year Month.

Any ideas how to realize it?

TomBond77_0-1708078962694.png

 

24 Replies
TomBond77
Specialist
Specialist
Author

only without data, is this possible?

 

theoat
Partner - Creator III
Partner - Creator III

Complicated to testing

theoat
Partner - Creator III
Partner - Creator III

It is a KPI

TomBond77
Specialist
Specialist
Author

Later on i will have to include it into a KPI. Here we only see the variable....

theoat
Partner - Creator III
Partner - Creator III

Okay i think i have the answer, can you try this ?
{<YM={"$(=Max({1}YM))"}>}Category

Kind regards,
Théo ATRAGIE.

TomBond77
Specialist
Specialist
Author

Thanks, but still not working:

Variable: 

TomBond77_0-1708092682515.png

 

TomBond77_1-1708092731931.png

 

 

Anil_Babu_Samineni

@TomBond77 Perhaps this?

firstsortedvalue (Category, -YM, 1)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
TomBond77
Specialist
Specialist
Author

Thank you, that was nearly the solution 🙂

TomBond77_0-1708093599068.png

How do I implement that logic in a KPI? The following code exists, only need to reflect the above situation....thanks for any help.

sum(
{<[YearMonth]={"$(='>=' & Monthstart(Addmonths(Max(YearMonth),-11)) & '<=' & MonthEnd(Max(YearMonth)))"}>}
Joiner)

theoat
Partner - Creator III
Partner - Creator III

This function is avaible in KPI. You need to use this in KPI no ?
If it is in a table, i am looking for resolve this.

Kind regards,
Théo ATRAGIE.

Anil_Babu_Samineni

@TomBond77 If i understand you want to pass the value from logic in tabular to KPI in analysis? Perhaps this?

sum(
{<[YearMonth]={"$(='>=' & Monthstart(Addmonths(Max(YearMonth),-11)) & '<=' & MonthEnd(Max(YearMonth)))"}, [Event Reason]={"$(Chr(39) & =firstsortedvalue (Category, -YM, 1) & Chr(39))"}>}
Joiner)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful