Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sbartelh
Contributor
Contributor

Time Dimension Collapsing

Hi,

I've been wrangling with this nasty little problem for the past few hours but didn't manage to solve without going back into the script.

My data basically looks like in the example. There's sales numbers for different products by calendar weeks. If I select some weeks I get beautiful average sales for all the different products. If, however, I also select a product , which doesn't have sales in every month, the time dimension collapses and I'm dividing by the wrong number of weeks.

Any suggestions?

I almost got there with variables and triggers but not quite...

Cheers

Stephan

2 Replies
chrismarlow
Specialist II
Specialist II

Hello,

Assuming you are adding a count distinct/total to get the weeks you can add set analysis to ignore the product selection;

Count({<Prod=>}DISTINCT TOTAL Week)

Also attached the QVW.

Cheers,

Chris.

sbartelh
Contributor
Contributor
Author

Hi Chris,

thanks a lot!

For some reason the expression didn't work in the table and produced different counts in different rows although it was supposed to ignore the only dimension: product. Putting the expression into a variable first, however, did the trick...

Cheers

Stephan