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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to SUM specific lines during LOAD

Dear ladies and gentleman,

I've been struggeling for days with the question following:

My table I'm loading in looks like:

Type // Value // Year

A // 1.5 // 2010

B // 2 // 2010

C // 1.7 // 2010

B // 1.1 // 2009

During my LOAD, I would like to SUM all Types A and B by each YEAR and store them as a new

value TYPE D for each year.

I haven't found a solution wheather in the QV Manual nore in the Community.

2 Replies
Not applicable
Author

Hi,

So far I have not seen a direct way to do this but you can have a workaround :-

Fact_Temp:

Load

Type,

Value,

Year

From FactFile.qvd;

Fact:

Noconcatenate Load

Year,

sum(Value) as Value,

'D' as Type

Resident Fact_Temp where Match(Type,'A','B')

Group by Year;

concatenate (Fact)

Load

Type,

Value,

Year

Resident Fact_Temp where not Match(Type,'A','B');

Drop Table Fact_Temp;

I hope this will help you.

Thanks & Best Regards

Kuldeep Tak

Not applicable
Author

Thank you very much. I'll give it a try. And verify your answer when it's working.