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: 
lavielme
Creator
Creator

calculate the last date for each company

Hay All

What Can I do If I need to calculate the last date for each company

depend on month selection

lats say

if i have 

    Company, Date, Stoc

    X, 30/05/2016, 10

    X,01/06/2016,15

     X,05/06/2016,20

    Y, 31/05/2016, 20

    Z, 31/05/2016, 30

    X, 30/04/2016, 40

    Y, 01/05/2016, 10

    Z, 02/05/2016, 30

    X, 28/03/2016, 40

    Y, 31/03/2016, 50

    Z, 31/03/2016, 10

    X, 27/03/2016, 20

    Y, 31/03/2016, 30

    Z, 01/04/2016, 40



AND I Select jun


i will see


Company    Stoc

X                    20



Best Regards

Lavi

4 Replies
swuehl
MVP
MVP

Hi Lavi,

what is the difference to your other requestß

SET EXP

If you want to see the latest stoc, try using FirstSortedValue() or the comparison within the advanced aggregation.

If you just want to see the latest date, you can use Max() function in an expression in a chart with dimension Company:

=Max(Date)

or

=Date(Max(Date))

lavielme
Creator
Creator
Author

The PRV Take the last date howervere is it

i need to calculate from the last date who selected

swuehl
MVP
MVP

What is PRV?

If you want to consider your expression all dates up to the current selected max date, you need to use set analysis, similar to what was used in the previous post:

FirstSortedValue(

     {<Date = {"<=$(=Max(Date))"}>}

Stoc, -Date)

If this is not what you need, please post a more complete description of your setting and requirements, best using a small sample QVW.

See also

A Primer on Set Analysis

Dates in Set Analysis

The Magic of Set Analysis - Point In Time Reporting • Blog • AfterSync

lavielme
Creator
Creator
Author

Hay swuehl thak a lot for your help its solved me a few problem's in my model