Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calculated values

Dear All,

I'm new and I woluld like to have calculated values as diff from meter counter ,

   

datemeter counterdiff
2017-04-04 01:0022628
2017-04-04 02:0022629,71,7
2017-04-04 03:0022631,41,7
2017-04-04 04:0022633,11,7
2017-04-04 05:0022634,91,8
2017-04-04 06:0022636,61,7
2017-04-04 07:0022638,31,7
2017-04-04 08:00226401,7

How can obtain this ?

4 Replies
beck_bakytbek
Master
Master

Hi Zelazek,

can you give a screenshot of example? what kind of output do you expect?

vishsaggi
Champion III
Champion III

Try this:

Table1:

LOAD * INLINE [

date, metercounter

2017-04-04 01:00, 22628

2017-04-04 02:00, 22629.7

2017-04-04 03:00, 22631.4

2017-04-04 04:00, 22633.1

2017-04-04 05:00, 22634.9

2017-04-04 06:00, 22636.6

2017-04-04 07:00, 22638.3

2017-04-04 08:00, 22640

];

NoConcatenate

LOAD date,

     metercounter,

     IF(metercounter - Previous(metercounter) = '', '', metercounter - Previous(metercounter)) AS Diff

Resident

Table1;

Drop Table Table1;

Using Straight table :

Dim:

date

metercounter

Expr:

diff

beck_bakytbek
Master
Master

Anil_Babu_Samineni

One Front-End Solution May be this?

Change the Environment ThousandSep from Comma(,) to Dot(.)

Then Try this?

Num(Sum([meter counter]) - Above([meter counter],1),'#,##0.0')

Or Simple do this without change any thing

Replace(Num(Sum(Replace([meter counter],',','.')) - Above(Replace([meter counter],',','.'),1),'#,##0.0'),'.',',')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful