Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Syntax - Share % Calc using Direct Discovery with Oracle DB

Direct Discovery

Oracle DB

How do you get the denominator of the share % calc to ignore Product dimension.

Sales Measure:

   

SalesTime
ProductMayJune
A1030
B1520
C1321
D1932
E1854
Total75157

Desired output (Denominator for Share Calc):

 

SalesTime
ProductMayJune
A75157
B75157
C75157
D75157
E75157

How do you get this in an expression.

AGGR(SUM(Sales),TIME) is giving the desired number but it displays only under one Product. As in, I get the below output:

 

SalesTime
ProductMayJune
A75157
B--
C--
D--
E--

What is the syntax to ignore Product and get the desired output?

Thanks in advance.

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Sum(Sales)/Sum(TOTAL <Time> Sales)

or

Sum(Sales)/AGGR(NODISTINCT SUM(Sales),TIME)

UPDATE: Added <Time> after reading through the requirement and seeing the response above me

View solution in original post

10 Replies
lironbaram
Partner - Master III
Partner - Master III

try

sum(Total <Time> Sales)

sunny_talwar

Try this:

Sum(Sales)/Sum(TOTAL <Time> Sales)

or

Sum(Sales)/AGGR(NODISTINCT SUM(Sales),TIME)

UPDATE: Added <Time> after reading through the requirement and seeing the response above me

Not applicable
Author

Thanks Sunny,

This worked - AGGR(NODISTINCT SUM(Sales),TIME)



sunny_talwar

Awesome, I am glad it did.

Would you be able to close the thread by marking correct answer.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny

Not applicable
Author

Hi Sunny,

Just an addendum to this.

What if instead of TIME I would like to reuse this formula (dynamically) for other dimensions example Region, Territory

AGGR(NODISTINCT SUM(Sales),TIME)

AGGR(NODISTINCT SUM(Sales),REGION)

AGGR(NODISTINCT SUM(Sales),TERRITORY)

Is it possible to combine the above three?

In the report either one of them will be used. Either there is TIME or REGION or TERRITORY in the report.

So instead of writing the formula for each dimension can we combine the formulas and make it dynamic?

sunny_talwar

Its doable, but how do you plan to toggle between TIME, REGION or TERRITORY?

Not applicable
Author

TIME, REGION or TERRITORY will be 3 different reports.

I wanted to reuse the same measure across the 3 reports

sunny_talwar

3 reports? meaning 3 different charts?

Not applicable
Author

yup