Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I got the data uploaded to QLIK sense i want to create a variable to pick just the last value according to max date.
in the sample the variable value should be 1500.
Hello,
Try to declare a variable with the following expression:
sum({$<Date={'$(=max(Date))'}>}[Sales])
Regards,
Nina
Thank you for collaboration, but Actually i do not need to sum the sales column i want just the latest value if you understand me. Thank you again !!!
Can we have more details ?
If you have two lines with the same max date, what do you want ?
OK, lets pretend that the data is updated from time to time, and i have to create this variable to hold the latest value without the summation of the total values. i have tried the AGGR function but the output is not what i expected.
Do you have an hour of the add/update ?
If so, it will be easier
If not, i think the best is to declare the variable in your script
You can try to order your values in the table and then use the "pick" function to have the latest value
For example on the "TABLE1":
TABLE1:
LOAD * INLINE [
NUM, DATE, SALES
1, 02/08/2024, 1254
2, 25/08/2024, 9999
3, 05/04/2024, 54
4, 02/05/2023, 1564
5, 31/07/2024, 543
6, 29/01/2022, 244
7, 25/08/2024, 4354,
8, 22/07/2023, 5546
]
;
NoConcatenate
TABLE2:
LOAD NUM,
DATE,
SALES
resident TABLE1
ORDER BY DATE, NUM
;
let vVariable=Peek('SALES');
drop table TABLE2;