Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
GregWP
Contributor II
Contributor II

Set Analysis doesn't (seem to) work in Aggr()

Hi,

I have this simple example where I want to always display every month regardless of selection.  I tried a calculated dimension using Aggr() but it has no effect -

=Aggr({1} MaxString({1} YrMth), YrMth)

I imagined this would return every YrMth but if I select a project it only returns those months with a related transaction. What am I misunderstanding?

Primarily I want a trend chart without missing months. 

Would appreciate any help.

5 Replies
jyothish8807
Master II
Master II

Hi GregWP,

 

Try this:

=Aggr(MaxString({1<Project= >} YrMth), YrMth)

if you have more fields like project, then add them also into the set analysis.

Br,

KC

Best Regards,
KC
GregWP
Contributor II
Contributor II
Author

Thanks KC, but I do want selection by other fields, e.g. see the trend over time for 'Project One'. What I'm looking for is for all the Year-Month values to display regardless of selections. This will form the x-axis of a bar chart.

Currently it ignores selection on YrMth itself but if I select Project it reduces to just the set of related transaction records. 

 

jyothish8807
Master II
Master II

May be this help:

Modify your expression as below, keep all dimensions as it is:

sum(Amount)+0*sum({1}Amount)

 

Br,

KC

Best Regards,
KC
GregWP
Contributor II
Contributor II
Author

Thanks KC,

I shortened this to + Sum({1} 0 )

 

jyothish8807
Master II
Master II

Great ! Please close the thread by marking the right answer 🙂

Br,

KC

Best Regards,
KC