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

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Conditional within another conditional set analysis

Hi People,

I have set analysis like this:

sum( {$< Year = {$(=only(left(Year-Month,4)))},  ID_Month={'<=2'}>}Amount

And this is working.

But i want to have one more conditional in ID_Month. I want to do this conditional working only in 2016 (last reporting year).

So in 2015 ID_Month could be all, from 1 to 12 but in 2016 i want to have only 1 and 2 month (less then 2)

Please help me Guys,

Thank you in Advance

Jacek Antek

Labels (1)
28 Replies
sunny_talwar
MVP
MVP

Not sure , but what about this:

D_Month={$(=If(Left($(vDateClosed), 4) = 2016

Anonymous
Not applicable
Author

Unfortunately, it is not working...:/

sunny_talwar
MVP
MVP

When you put vDateClosed in a text box object, what do you see?

Anonymous
Not applicable
Author

I see:

So even if i wrote in tex box :  left($(vDateClosed),4) i have seen 2016.

sunny_talwar
MVP
MVP

What about this in text box:

=If(Left(vDateClosed, 4) = 2016, Chr(39) & '<=2' & Chr(39), Chr(39) & '*' & Chr(39))

Should give you '<=2' when you have 201602 in vDateClosed. for any other year you should see '*'

Anonymous
Not applicable
Author

yes it is working:

Maybe this is a problem within chart bar - im trying to implement this expression there.

sunny_talwar
MVP
MVP

So this isn't working?

Sum({$<Year = {$(=Only(Left(Year-Month,4)))}, D_Month={$(=If(Left(vDateClosed, 4) = 2016, Chr(39) & '<=2' & Chr(39), Chr(39) & '*' & Chr(39)))}>} Amount)

Is there a possibility to share a sample?

Anonymous
Not applicable
Author

Yes this isn't working.

It will a problem with sharing this - data are only for company use and i can not share applications ;/

hmm i can manually insted of Left(vDateClosed,4) write there Year = '2016' but it is not satisfying me

sunny_talwar
MVP
MVP

It's strange it isn't working, can you share a screenshot of the output? What is the error you are seeing?

Anonymous
Not applicable
Author

Ok,

my expression is more advanced then in example, i didnt want to bother yoy with this.

But still problem is the same.

When i have:

num(Sum({$<MO_ID={1}, Year= {$(=only('20'&(Left([Year-Month],2))))}, Month=,
ID_Month={"$(=if(left(vDateClosed,4)='2016','<=$(=right(vDateClosed,1)*1)','<=$(=Max({1} ID_Month))'))"}>}Amount)/1000,'# ##0.00') it is not working.

When i have :

num(Sum({$<MO_ID={1}, Year= {$(=only('20'&(Left([Year-Month],2))))}, Month=,
ID_Month={"$(=if(Year='2016','<=$(=right(vDateClosed,1)*1)','<=$(=Max({1} ID_Month))'))"}>}Amount)/1000,'# ##0.00')

It is working, it is strange. Only different is in writing variable instead of column header.