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: 
narender123
Specialist
Specialist

Condition in expression

Hi team,

I want a expression in table like this:

IF TP_YEAR IS NOT NULL THEN

SUM(AMOUNT) WHERE FIRST_YEAR<v(YEAR)

IF TP_YEAR IS NULL THEN

SUM(AMOUNT) WHERE SECOND_YEAR<v(YEAR)

IF BOTH ARE NULL THEN

SUM(AMOUNT)

I want to set all 3 condition .Pls give me suggestion to sort out.

Thanks,

Narender

5 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

The more (context) information you supply, the better the suggestions.

Script of Chart?

Which of the names in your pseudo-statement are QlikView fields?

What is your data model?

alexandros17
Partner - Champion III
Partner - Champion III

What do you mean for BOTH are null, Both ??

narender123
Specialist
Specialist
Author

Hi Peter,

Thanks for your reply.

FOR FIRST CONDITION

LIKE:

=SUM({<FIRST_YEAR={"<$(vYEAR)"}>}AMOUNT)


here vYEAR is varible means max(year) 

I want to include all condition as i wrote in my question above.

Thanks,

narender123
Specialist
Specialist
Author

Hi Saccone,

Both means

FIRST_YEAR and SECOND_YEAR conditions are Null.

because at some place both condition(FIRST_YEAR and SECOND_YEAR)  heaving no value means null.At such situation i want all of them null year.



Thanks,

alexandros17
Partner - Champion III
Partner - Champion III

If(IsNull(TP_YEAR)=0,
Sum({$ <FIRST_YEAR={'<$(vYEAR)'}>} Amount),
If(IsNull(TP_YEAR)=-1,
Sum({$ <SECOND_YEAR={'<$(vYEAR)'}>} Amount),
If(BOTH are null ???,
Sum(Amount),
'Undefined'
)
)
)