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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Complex set analysis within a if statement........

Hi Guys,

I'm doing a set analysis within an If statement, It works perfect when i select one value from a list box and it shows it perfect in a single row, but when i wanna see all the values, they have the same value as the result.

Any help, top of your head?  I know i'll probable need to show some data and what I've done, I'm working on a dummy data demo.

Thanks

And long time no chat.

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Got it working

=if(num(SUM({<VER={$(vPreviousMonth)},YR={$(vCurrentYear)}>}EPRC)/1000,'#,##0')

-

(sum({<VER={"OPEN"}>}EPRC)/1000

+

sum({<VER={"ACT"}>}EPRC)/1000)<0,0,num(SUM({<VER={$(vPreviousMonth)},YR={$(vCurrentYear)}>}EPRC)/1000,'#,##0')

-

(sum({<VER={"OPEN"}>}EPRC)/1000

+

sum({<VER={"ACT"}>}EPRC)/1000))

View solution in original post

16 Replies
oscar_ortiz
Partner - Specialist
Partner - Specialist

You're going to need to provide some more information.

What is the actual expression that you are having issues with?

Anil_Babu_Samineni
MVP
MVP

Looks like strange issue. What is the condition and where do you use ??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Or if i do it this way, it shows me the value if below "0" , I want it to show me 0, if below and the value if higher than 0.

=if((sum({<VER={"OPEN"}>}EPRC)

+

sum({<VER={"ACT"}>}EPRC)

-

sum({<VER={"OPEN"}>}EPRC)<0),'0',sum({<VER={"OPEN"}>}EPRC)

+

sum({<VER={"ACT"}>}EPRC)

-

sum({<VER={"PLAN"}>}EPRC))

Anonymous
Not applicable
Author

That's what I was afraid of lol.

Anonymous
Not applicable
Author

Pivot table

Anil_Babu_Samineni
MVP
MVP

May be this? Looks like mis place the close parenthesis

=if((sum({<VER={"OPEN"}>}EPRC) + sum({<VER={"ACT"}>}EPRC) - sum({<VER={"OPEN"}>}EPRC))<0,'0',(sum({<VER={"OPEN"}>}EPRC)+sum({<VER={"ACT"}>}EPRC)-sum({<VER={"PLAN"}>}EPRC))


OR


(sum({<VER={"OPEN"}, ERPC = {"Sum(ERPC) < 0"}>}EPRC)+sum({<VER={"ACT"}, ERPC = {"Sum(ERPC) < = 0"}>}EPRC)-sum({<VER={"PLAN"}, ERPC = {"Sum(ERPC) < 0"}>}EPRC))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

None of them worked.

I know it's hard to do without all the data and to see what I've done so far.

vishsaggi
Champion III
Champion III

Try this?

= if( RangeSum(sum({<VER={"OPEN"}>}EPRC),sum({<VER={"ACT"}>}EPRC)) - sum({<VER={"OPEN"}>}EPRC) < 0, 0,

      RangeSum(sum({<VER={"OPEN"}>}EPRC),sum({<VER={"ACT"}>}EPRC)) - sum({<VER={"PLAN"}>}EPRC))

Anonymous
Not applicable
Author

No,  That's giving me the same results as mine.

I want

The expression to = '0' if I've reached my target (), and show the value needed if I haven't reached my target.