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

w/ Calculated Dimensions, what should expression look like?

Hello,

Hi,

I'm trying to display loyalty by the latest year puchased vs. the number of years purchased.

I have 2 calculated dimensions in a pivot table:

=aggr(count(distinct Year),GrpEnt)



=aggr(max (Year),GrpEnt)

So, how should my expression look ?

count(aggr(max(Year),GrpEnt)) gives me a number that's in the ballpark, but Im not sure it's right?

I'd appreciate any help.

Thanks - Tim







1 Solution

Accepted Solutions
pover
Partner - Master
Partner - Master

Tim,

It will probably give you the same result, but formula probably should be count(distinct GrpEnt) to how many GrpEnt are found in the grouping you making dynamically in the calculated dimensions for # of years and latest year. Since aggr() returns a list and the count returns the number of the GrpEnt 's in the list it will probably give you the same result, but it's simpler to use count(distinct GrpEnt).

Regards.

View solution in original post

2 Replies
pover
Partner - Master
Partner - Master

Tim,

It will probably give you the same result, but formula probably should be count(distinct GrpEnt) to how many GrpEnt are found in the grouping you making dynamically in the calculated dimensions for # of years and latest year. Since aggr() returns a list and the count returns the number of the GrpEnt 's in the list it will probably give you the same result, but it's simpler to use count(distinct GrpEnt).

Regards.

Not applicable
Author

Belated, thank you 🙂