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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Script help

hi can someone help me please convert the folloowing into set analysis code

if (pers_race LIKE 'Black' AND pers_isowner LIKE 'Y' AND isNull(Comp_Deleted) AND isNull(Terr_Deleted)  AND IsNull(Pers_Deleted) AND comp_status = 'WorkingWith' AND Terr_ChildCount = 0, count(PeLi_PersonId))

thanks alot

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

count({<pers_race={'Black'},pers_isowner={'Y'}>,Comp_Deleted-={'*'},Terr_Deleted-={'*'},Pers_Deleted-={'*'},comp_status={'WorkingWith'},Terr_ChildCount={0}>} Peli_PersonID)

The expression editor flags -= as wrong (underlined red), but that's a bug in the editor.


talk is cheap, supply exceeds demand
Not applicable
Author

i am a bit confused here so how can you write the one below which is comparing two fields?

if (netw_Secterr =Terr_TerritoryID AND Terr_ChildCount = 0 AND  netw_eventfocus = 'Black'  And isNull( netw_Deleted), count(netw_NetworkEventID))

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You are aware that

     If(  <cond> ,  Sum(....))

is not the same as

     Sum(If( <cond>, ....))

The first one, as per the orogonal post, does not lend itself to a set expression because the condition is outside the aggregation function...

Just my 2c - perhaps the OP meant a sum(if())...

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein