Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help needed on set analysis

Hi Team,

I need your Precious help on set analysys.

I have two  fields called [emp year of hire] and [emp name].

Now i have towrite a set expression to show the sum(sal) for employees whose year of hire is 2010 to 2015 and also have to include sal of employees  if anybody having null value as [emp year of hire].

Thanks in advance.

Best Regards,

Nani.

8 Replies
avinashelite

try like this:

if( ([emp year of hire]>=2010 and [emp year of hire]<=2015) or [emp year of hire]=null(),sum(sal))

or

sum({<[emp year of hire]={">='2010'<='2015'"}>}sal)

PrashantSangle

Hi,

Try this,

sum({<[emp year of hire]={">=2010<=2015"},[emp year of hire]={"=ISNULL([emp year of hire])"}>}Sal)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi avinash,

Thanks for your reply.

My requirement is to incorporate null value condition in set expression.

tried ur expression but it is giving results for only given years not for null values.

Regards,

Nani

Not applicable
Author

Hi Max,

Thanks for your reply...

The expression that u mentioned is returning ' 0' as a result.

Regards,

Nani.

PrashantSangle

Hi,

Try

Simple if else

try like

sum(if((isnull([emp year of hire]) or len(trim([emp year of hire]))=0) or ([emp year of hire]>=2010 AND [emp year of hire]<=2015),Sal))

Note: Check Bracket if any missing

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
stigchel
Partner - Master
Partner - Master

Can you try with

Sum({1-< [emp year of hire]={"<2010"} >} Sal)

Not applicable
Author

Try this,

sum({<[emp year of hire]={">='2010'<='2015'"}>}sal) + Sum(If(IsNull([emp year of hire]),sal,0))

Kushal_Chawda

Try like this


sum({<[emp year of hire]={">=2010<=2015"}>} if(ISNULL([emp year of hire]),Sal,Sal))