Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Fix a value

Hi everybody.

My script is

LOAD   DEVICE,

          MAX(`ENERGY`) AS MAX_MONTH,

          MIN(`ENERGY`) AS MIN_MONTH,

          Month(DATETIME) AS MONTH,

          Year(DATETIME) AS YEAR,

RESIDENT DATA

          GROUP BY IDPARK,IDDEVICE,Month(DATETIME),Year(DATETIME);

I need the SUM of (MAX_MONTH-MIN_MONTH) for each DEVICE in the current month.

I create a graph, put as Dimension :  MakeDate(Year(now()),Month(now())

and the expression : sum(MAX_MONTH - MIN_MONTH)

but doesn't work...any help ?

The problem is linked to the dimension because i already used the expression in another graph  "month by month" and works

3 Replies
somenathroy
Creator III
Creator III

Hi,

You can try the following:

put DEVICE as dimension use sum({<YEAR={'$(=year(today()))'}, MONTH={'$(=month(today()))'}>} MAX_MONTH- MIN_MONTH) as EXPRESSION.

Regards,

Som

Anonymous
Not applicable
Author

I need the total sum of the devices, not the sum of each device.

i wrote badly, my mistake.

somenathroy
Creator III
Creator III

In that case put YEAR and MONTH in dimension list and use the same expression mentioned in my previous post.