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

requirement for sum

hi all,

I have requirement as per below,

I have values from  Jun to december.

Value of jun is base

July values is= Value of June+ Value of July.

august values== Value of June+ Value of august.



september values= Value of June+ Value of september.


Can you please suggest how to achieve this.



Thanks



1 Solution

Accepted Solutions
Anil_Babu_Samineni

When we talk related base is june, You could try

Sum({<Month = {'Jun'}>}Sales)+Sum(Sales)

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

View solution in original post

7 Replies
Anil_Babu_Samineni

When we talk related base is june, You could try

Sum({<Month = {'Jun'}>}Sales)+Sum(Sales)

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
techvarun
Specialist II
Specialist II

Check the attached app

kishorj1982
Creator II
Creator II
Author

Thanks Anil,

Can you please suggest how to achieve this in backend.

thanks

techvarun
Specialist II
Specialist II

Use below script if you want to achieve this in backend

TEST:

LOAD * INLINE [

    Month, Sales

    Jan, 10

    Feb, 20

    Mar, 30

    Apr, 40

    May, 50

    Jun, 60

    Jul, 70

    Aug, 80

    Sep, 90

    Oct, 100

    Nov, 110

    Dec, 120

];

Join Load Sales as BasePrice Resident TEST Where Month ='Jun';

Load*, If(Month = 'Jun',Sales,Sales+BasePrice) as FinalPrice Resident TEST;

DROP TABLE TEST;

Anil_Babu_Samineni

Perhaps this?

File:

Load Month,

         Sales

From Table;

Final:

NoConcatenate

Load Month, Sum(Sales) as Sales Resident File Where Match(Month, 'Jun') Group by Month Order By Month Desc;

Left Join (Final)

Load Month, Sum(Sales) as Sales Resident File Group By Month;

Drop Table File;

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
kishorj1982
Creator II
Creator II
Author

can u plz suggest how to achieve this by using if else condition in expression

Anil_Babu_Samineni

Are you playing in community?? Not sure, What requirement you have. I am sorry

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