Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

subtracting data from two dates

Hi,

I have cumulative data.I want to get the actual data by subtracting data from two dates.

Ex.Date                         Power                    Actual Power

    1/08/2013                    11000                    11500-11000=500

    2/8/2013                      11500                     12000-11500=500        

    3/8/2013                      12000                     Data from 4/8/2013-12000

I am plotting a chart for the same.

I have used

only({<Billing_DAY={$(=Only(Billing_DAY))}>} Billing_KWH_FWD) - only({<Billing_DAY={$(=Only(Billing_DAY-1))}>} Billing_KWH_FWD)

But it is not working.

Thanks

Asmita

6 Replies
Not applicable
Author

Hi,

PFA

jagan
Partner - Champion III
Partner - Champion III

Hi Asmita,

You can do this in script by using the below script

LOAD

     *,

     If(RowNo() <> 1, Previous(Power) - Power, Power) AS [Actual Power]

FROM TableName

Order by Date Desc;

Regards,

Jagan.

Not applicable
Author

Hi

use this expression

below(Power,1)-Power

or

below(power)-power

in ur chart expression

Not applicable
Author

Hi Jagan,

I also want to subtract next record from today's record.

Kushal_Chawda

see the attached one

jagan
Partner - Champion III
Partner - Champion III

Hi,

I didn't get you, can you come up with some sample data.

Regards,

Jagan.