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: 
DarioDella
Contributor
Contributor

Compare today's KPIs with yesterday's

Hello everyone, I'm learning to use qlik sense: I created an application on qlik sense that calculates certain kpis at each data reload (which happens once a day).
I'd like to know if there is a way to be able to compare the kpi calculated today with those calculated yesterday.
Not having a Date field, I created it in the script like this:

rename table Table_1 to Table_1_tmp;
NoConcatenate Table_1:
load*,
date(timestamp(now())) as Timestamp
resident Table_1_tmp;
drop table Table_1_tmp;

however it is not clear to me now how I could compare the kpis calculated today with those calculated yesterday. I tried something like this, but looking back on it I don't think it's correct because reviewing the code I'm not keeping track of yesterday's results:


if (
Avg({<field1 = {'x'}>} field2) > Avg({<field1 = {'x'}, Timestamp = {"=$(=date(today()-1,'DD/MM/YYYY '))"}>} field2), '▲',
if (
Avg({<field1 = {'x'}>} field2) < Avg({<field1 = {'x'}, Timestamp = {"=$(=date(today()-1,'DD/MM/YYYY '))"}>} field2), '▼', 'No Change')
)

Could anyone suggest me a way that I can get a comparison of the kpi between yesterday and today? Thanks all.

Labels (1)
0 Replies