Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis

Hi All,

Can someone tell me what's wrong with the below formula.

=(Sum({[BookRev]<QuarterNum={"$(=Max({$}QuarterNum))"}, [DimYear] ={"$(=Max({$}[DimYear]))"}>} grossamount)

-

Sum({[BookRev]<QuarterNum={"$(=If(Max({$}QuarterNum) - 1 = 0, 4, Max({$}QuarterNum)-1))"}, [DimYear] ={"$(=If(Max({$}QuarterNum) - 1 = 0, Max({$}[DimYear]) - 1, Max({$}[DimYear])))"}>} grossamount) * 4

/

Sum({[BookCost]<QuarterNum={"$(=If(Max({$}QuarterNum) - 1 = 0, 4, Max({$}QuarterNum)-1))"}, [DimYear] ={"$(=If(Max({$}QuarterNum) - 1 = 0, Max({$}[DimYear]) - 1, Max({$}[DimYear])))"}>} grossamount))

When I apply these formulas separately they all work, once I put all of these together in one formula it only gives me the value for the first part (the one in the orange).

Thanks in Advance,

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You essentially calculate something like

A - B/C

You don't get just A, but B/C results in a number much smaller than A, that's why you think you only get A.

Maybe you want to calculate

(A-B ) / C

?

Then just add parentheses accordingly.

View solution in original post

5 Replies
swuehl
MVP
MVP

Could you upload a small sample QVW that demonstrates the issue?

It's hard to tell what's wrong without knowing the context.

Not applicable
Author

Please find attached the sample sheet.

sunny_talwar

What is the output you are hoping for? With and without selections?

swuehl
MVP
MVP

You essentially calculate something like

A - B/C

You don't get just A, but B/C results in a number much smaller than A, that's why you think you only get A.

Maybe you want to calculate

(A-B ) / C

?

Then just add parentheses accordingly.

Not applicable
Author

Thanks Stephen for you help