Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Prabhu1204
Creator
Creator

Sum and Max

Hi

I have a Date Filed, Actual field ,Target field

In the UI I have a date picker , On selecting the dates.. say for example jan to march. I need to sum the values between maximum values of each month.

maximum of jan month + max of feb + max of march.

How to do it in load script

-Prabhu
1 Solution

Accepted Solutions
Taoufiq_Zarra

@Prabhu1204  can you share a sample data and the expected output ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

4 Replies
Taoufiq_Zarra

@Prabhu1204  can you share a sample data and the expected output ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Prabhu1204
Creator
Creator
Author

 
-Prabhu
Taoufiq_Zarra

@Prabhu1204  for example you can create in load script :

data:
load *,Month(Date) as MonthTmp; 
LOAD Date(Date) as Date, 
     Actual
FROM
[C:\Users\admin\Downloads\sample input.xlsx]
(ooxml, embedded labels, table is Sheet1);



load MonthTmp,FirstSortedValue(Actual,-Date) as Value2 resident data group by MonthTmp;

 

and then for the output use :

sum(Value2)

output:

for jan to feb

Taoufiq_Zarra_0-1617630129747.png

 

until march:

Taoufiq_Zarra_1-1617630168443.png

 

Taoufiq_Zarra_2-1617630183708.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Prabhu1204
Creator
Creator
Author

Its not working for me.. Not sure what i am doing working. One for march i am getting the value

 

-Prabhu