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

Trying to use p() function

I have created a straight table which incorporates the following expression as "First"

sum ( { $<YearPeriod={'2010 01'}>} LineValue)

and I get the following result

GroupYearPeriod        Sum        First
Cans201001308,730308,730
Solvent201001311,696311,696
Metal201001366,314366,314
Resin201001848,321848,321
General201001911,037911,037
Cans201002321,6080
Solvent201002356,7580
Metal201002442,5050
Resin201002950,2340
General201002955,7100
Cans201003378,9450
Metal201003394,8610
Solvent201003403,6480
Resin2010031,082,1860
General2010031,129,2120
Cans201004374,6030
Solvent201004380,6560
Metal201004567,9260
General2010041,076,6360
Resin2010041,114,3540
Cans201005409,9350
Solvent201005485,4220
Metal201005646,6200
General2010051,039,3030
Resin2010051,310,0150

But what I actually want is this...

GroupYearPeriod        Sum        First
Cans201001308,730308,730
Solvent201001311,696311,696
Metal201001366,314366,314
Resin201001848,321848,321
General201001911,037911,037
Cans201002321,608308,730
Solvent201002356,758311,696
Metal201002442,505366,314
Resin201002950,234848,321
General201002955,710911,037
Cans201003378,945308,730
Metal201003394,861311,696
Solvent201003403,648366,314
Resin2010031,082,186848,321
General2010031,129,212911,037
Cans201004374,603308,730
Solvent201004380,656311,696
Metal201004567,926366,314
General2010041,076,636848,321
Resin2010041,114,354911,037
Cans201005409,935308,730
Solvent201005485,422311,696
Metal201005646,620366,314
General2010051,039,303848,321
Resin2010051,310,015911,037

How do I apply the p() function to make this work?

Thanks

QlikView for Windows Version 9.00.7646.9 SR6

(Just as an aside, is there a preferred browser or some add-in I should be running, as I find the messaging on this forum extremely slow and difficult to use? It has taken me 15 minutes or more to compile this message.)

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I don't think you need the p() function here, but a total qualifier, maybe like

=sum ( { $<YearPeriod={'201001'}>} total<Group> Sum)

Regards,

Stefan

P.S.

I use Firefox on WindowsXP, and this works quite nicely, but I have heared of some issues with browsers and the forum.

View solution in original post

2 Replies
swuehl
MVP
MVP

I don't think you need the p() function here, but a total qualifier, maybe like

=sum ( { $<YearPeriod={'201001'}>} total<Group> Sum)

Regards,

Stefan

P.S.

I use Firefox on WindowsXP, and this works quite nicely, but I have heared of some issues with browsers and the forum.

Not applicable
Author

Oh my good God!!!

That is so brilliant Stefan, and so simple.

I have gone round so many houses trying combinations of set analysis and group functions and made zero progress, hence my venture in indirect set analysis.

I think this might just have kicked one of the doors down for me.

Many thanks!