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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of values in script with time period key

Hi All

I was wondering if anyone had any ideas on how to do this in the script?

Currently we do a sum set analysis of the values in the pivot table chart  and is broken down by the dimensions - year and quarter

however i need to move this calcution to the loading script as need to do a calculation based on this and other figures for another expression.

I have a table which has a time period key (TP_KEY) unique for each quarter and also a VALUE field.

There can be many different VALUE field lines for each TP_KEY and I need to sum the values by each TP_KEY. All i need is the sum of the VALUE field for each TP_KEY.

What would be the best way to do this in the script?

Any examples would be a great help.

Many thanks in advance.

Sye

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Use Group by

     Load

          TP_KEY,

          Sum(VALUE) as Total

     Resident SourceTable Group By TP_Key;

Hope it helps

Celambarasan

View solution in original post

2 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Use Group by

     Load

          TP_KEY,

          Sum(VALUE) as Total

     Resident SourceTable Group By TP_Key;

Hope it helps

Celambarasan

Not applicable
Author

Hi Ceambarasan

That worked perfect.

Many Thanks

Sye