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
theoat
Partner - Creator III
Partner - Creator III

You can do this with a variable.
Here's an example made on a personal case (I named the variable vLastFruit):
Capture d'écran 2024-02-16 113710.pngCapture d'écran 2024-02-16 113723.png

For your case, here is the formula to use in varibale vLastCategory :
{<YM={"$(=Max(YM))"}>}Category

When using your variable, keep in mind the $ --> $(vLastCategory).

Kind Regards,
Théo ATRAGIE.

TomBond77
Specialist
Specialist
Author

Thanks,

Is this variable correct?

TomBond77_0-1708081658336.png

 

theoat
Partner - Creator III
Partner - Creator III

In my opinions, yes !

TomBond77
Specialist
Specialist
Author

is this a text box?

TomBond77_0-1708082185815.png

 

TomBond77
Specialist
Specialist
Author

something is yet not correct, can you help?

TomBond77_1-1708082737519.png

 

TomBond77
Specialist
Specialist
Author

I corrected the variable: 

TomBond77_1-1708083133686.png

But I am still getting the wrong Event Reason in the table for 2023-Feb: For all month I would expect the last value from 2024-Jan. Any ideas?

TomBond77_2-1708083193382.png

 

 

 

theoat
Partner - Creator III
Partner - Creator III

In this case, add the operator 1 at your set analysis in the variable.
Like this :
{1<YM={"$(=Max(YM))"}>}Category

TomBond77
Specialist
Specialist
Author

Thanks, I have changed the variable vLastEventReason:

TomBond77_0-1708084874388.png

But still get the same result:

TomBond77_1-1708084909917.png

 

 

 

theoat
Partner - Creator III
Partner - Creator III

Can you share the .qvf?