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: 
Not applicable

[HELP] previous function for expresion

hello..

is there any previous function that i can use for expression in a chart table instead of below or above?

i have a case that i have 3-days-group which is 1 day of group have 3 days

so i have to do max(curr_value)-max([yesterday_value])

i've tried max(curr_value)-prev(max(curr_value))

but there is no effect and no value show up

so how to use previous function in chart table expression?

many thx...

2 Replies
Miguel_Angel_Baeyens

Hello,

Previous() function works record wise, so it won't work in a pivot table. Why don't you want to use inter-record above(), below() (rows) after(), before() (columns) functions. If there is a dimension for any day, these functions will work fine. Depending on the dimensions you can use set analysis, though.

Say you have Day as dimension (row), sorted ascending and

Sum(Value)
as expression for the current value. Then
above(Sum(Value))
will return the sum for the previous day.

If the dimension is a group of three days, and this is linked to a master calendar, then you can use set analysis like (untested)

Sum({< Day = {'$(=aggr(max(Day), GroupOfThreeDates) -1)'} >} Value)


Regards.

Not applicable
Author

hello Miquel..

i've tried with below() function but the result is not correct

and i also have tried with syntax below :

Sum ({$<DayGroupThree={"$(=max(DayGroupThree)-1)"}>}
aggr(max(curr_value)-min(curr_value),DayGroupThree_sci)
)

but the result is also not showing the value before today

i really need a help...

many thx..