Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Partial sum with a condition in a straight table

Hi All,

Thanks everyone for the reply for my previous posts.

In a straight table i have values like Certified Diverse,Classified Diverse and Non diverse in a single dimension called Group.

Is it possible for me to do a partial spend as shown below ?

Example: Certified Diverse 1,228,081,835.09 0.8%

Classified Diverse 1,646,795,072.01 1.1%

TOTAL DIVERSE 2,874,876,907.10 1.9%

Non Diverse 146,918,563,301.52 98.1%

TOTAL SPEND 149,793,440,208.62 100.0%

Thanks.

5 Replies
matt_crowther
Luminary Alumni
Luminary Alumni

I'd look to do that in Pivot Table.

If that's not an option I have in the past used a combination of the rangesum() and above() functions.

Hope that helps,

Matt - Visual Analytics Ltd

Not applicable
Author

Thanks Matt. I am new to Qlikview. Can you please tell me how to use the rangesum() and above() function.

Not applicable
Author

Hi,

Attached is an example with a solutions for your problem.

Hope this helps

Regards!

Not applicable
Author

Thanks a lot Gabriela. It worked.

johnw
Champion III
Champion III

I think you'd be better off putting the complexity in the load script instead of in the chart:

Groups:
LOAD
"Diverse Type Group"
,subfield("Diverse Types",', ') as "Diverse Type"
INLINE [
Diverse Type Group: Diverse Types
Certified Diverse: Certified Diverse
Classified Diverse: Classified Diverse
TOTAL DIVERSE: Certified Diverse, Classified Diverse
Non Diverse: Non Diverse
TOTAL SPEND: Certified Diverse, Classified Diverse, Non Diverse
] (delimiter is ':');

And then just building your chart with "Diverse Type Group" as the dimension, sorted in original load order. Then your expressions are a simple sum(Qty) and sum(Percent), and QlikView's associative logic handles the rest.

See attached expansion of Gabriela's example to include this alternative approach.