Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

get a value from the list by date

I have two fields:
Date - Dias_Plazo
02/07/12 - 20
02/07/12 - 40
02/08/12 - 30

The grouping by date dias_plazo to take either higher or lower in the list.

I used:

 

=aggr(max(Dias_Plazo),MakeDate(var_ano_1,var_mes_1,var_dia_1)))

Not function el makedate.

Help me please,

1 Solution

Accepted Solutions
swuehl
MVP
MVP

So you have two fields, Dias_Plazo and Date,  and three variables. The user sets the variables and you want to look up the max Dias_Plazo for the Date field value that equals the created date using the variables?

Maybe like

=max( if(Date=makedate(var_ano_1,var_mes_1,var_dia_1),Dias_Plazo))

or

=max({<Date= {$(=makedate(var_ano_1,var_mes_1,var_dia_1))}>} Dias_Plazo)

View solution in original post

6 Replies
swuehl
MVP
MVP

The aggr() function does not take calculated dimensions, only fields, and all arguments after the very first are dimensions to the aggr() function. So MakeDate() is not allowed as second argument / aggr() dimension.

I am not quite sure what you want to achieve with your expression, are you maybe looking for something like the FirstSortedValue() function?

Not applicable
Author

FirstSortedValue () function does not accept duplicate values ​​in the sort field,
= Firstsortedvalue (Dias_Plazo, MAKEDATE (var_ano_1, var_mes_1, var_dia_1)).
in case of a repeat date me sent null

help me please

swuehl
MVP
MVP

You can use DISTINCT qualifier to get an answer:

=FirstSortedValue(DISTINCT Dias_Plazo, .....)

I still don't get what you are trying to achieve with the makedate() function. I assume var_ano_1 etc are variables, right?

Can you give us an example input and desired output?

Not applicable
Author

variables are var_ano_1 etc.
I have a

Dos Campos:

Dias_Plazo and Date (var_ano_1, var_dia_1, var_mes_1)
20   -                02.01.2012
30 -                 02.01.2012
40,                    03.01.2012
  I need to get for example the value 30 of field Dias_plazo, and he has the same date as the value 20.

How do I get the value if both have the same date

swuehl
MVP
MVP

So you have two fields, Dias_Plazo and Date,  and three variables. The user sets the variables and you want to look up the max Dias_Plazo for the Date field value that equals the created date using the variables?

Maybe like

=max( if(Date=makedate(var_ano_1,var_mes_1,var_dia_1),Dias_Plazo))

or

=max({<Date= {$(=makedate(var_ano_1,var_mes_1,var_dia_1))}>} Dias_Plazo)

Not applicable
Author

Thank you,

I worked the first option

thank you very much