Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I dont understand why my peek sometimes get strange numbers
In this case appears a number that duplicated and some number off order.
any help please.
Corrige_Medidor:
LOAD
DISTINCT
OID_METER,
VALUE_READ AS VALOR,
DATA,
TEMPO
RESIDENT TMP2
ORDER BY OID_METER,DATA,TEMPO DESC;
NoConcatenate
Teste_Medidor:
LOAD
OID_METER,
VALOR,
DATA,
TEMPO,
peek(VALOR),
peek(VALOR)- VALOR AS DIFERENCA
RESIDENT Corrige_Medidor
ORDER BY OID_METER,DATA,TEMPO DESC;
drop table Corrige_Medidor;
is your table also sorted by in the same order as the orderby clause?
OID_METER,DATA,TEMPO DESC;
try with Previous(Valor) instead of Peek()
is your table also sorted by in the same order as the orderby clause?
OID_METER,DATA,TEMPO DESC;
try with Previous(Valor) instead of Peek()
Hi Eduardo,
it's a bit hard to troubleshoot your app without seeing it, but here is what I think is happening:
1. Your never verify that OID_METER remains the same from the previous records. So, you might be picking up the values of peek(VALOR) from the previous meter ID. In order to avoid that, your formula should be:
IF(Peek(OID_METER) = OID_METER, peek(VALOR), null()) as [Last VALOR]
2. Your data is sorted by OID, Date, and Time (in descending order), but your data in the screenshot is not sorted by Time, hence the "previous" values look confusing. If you sort your table on the screen the same way you sorted your data, it will look less confusing.
If you need a deeper analysis, please post a sample of your App.
cheers,
Upgrade your Qlik skills at the Masters Summit for Qlik - coming soon to Munich, Germany and Boston, MA!
Hi Vinneth,
Get the same problem, and i dont know how to check if my table is sorted by OID_METER,DATA,TEMPO DESC
Hi Vinneth,
That was my mistake, i checked on internet how to order by my table and when i did that the results match.
Thank you very much