Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mohan_1105
Partner - Creator III
Partner - Creator III

How to nullify a field in aggr function

Hi Qliker,

 

Nullification isn't working in my expression. The output of the expression is working as expected but I need to nullify a field.

Following is my expression:

sum({<Header=>}

Aggr(


if("Green_Ind" = '≤' and [Scored? (Y/N)]='Y' and sum({<Header=>}Deno) <> '0',
if(sum({<Header=>}Numerator)/sum({<Header=>}Deno/Divisor) <= avg({<Header=>}"Green"),1),


if("Green_Ind" = '≥' and [Scored? (Y/N)]='Y' and sum({<Header=>}Deno) <> '0',
if(sum({<Header=>}Numerator)/sum({<Header=>}Deno/Divisor) >= avg({<Header=>}"Green"),1)))

 

,Header,[Measure Title],KPI))

 

A doubt, can I nullify the field which is been used to aggregate the data?

 

Regards,

Mohan

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

So, all you want is to ignore selection in Header field? Try this

count({<Header=>}
Aggr(

if(only({<Header=>}"Green_Ind") = '≤' and only({<Header=>}[Scored? (Y/N)])='Y' and sum({<Header=>}Deno) <> '0',
if(sum({<Header=>}Numerator)/sum({<Header=>}Deno) <= avg({<Header=>}"Green"), Only({<Header>}[Measure Title])),

if(only({<Header=>}"Green_Ind") = '≥' and only({<Header=>}[Scored? (Y/N)])='Y' and sum({<Header=>}Deno) <> '0',
if(sum({<Header=>}Numerator)/sum({<Header=>}Deno) >= avg({<Header=>}"Green"),Only({<Header>}[Measure Title]))))
 
,Header,[Measure Title],KPI))

View solution in original post

11 Replies
mohan_1105
Partner - Creator III
Partner - Creator III
Author

Hi Qliker,

 

Do we have any help..!!!

sunny_talwar

Nullify? What exactly are you trying to nullify here? I am not entirely sure I understand

mohan_1105
Partner - Creator III
Partner - Creator III
Author

Hi Sunny,

I wanted to make the expression static when the user select "Header" field. So I have included the field disabling function as you could see in my expression {<Header= >}. 

Even after I added the field as mentioned above, the "Header" field is interacting with the chart.

 

Regards,

Mohan

Vegar
MVP
MVP

When writing something like ...
"Green_Ind" = '≤'
...in an expression you are actually saying...
Only("Green_Ind") = '≤'
...which is not an "nullified" expression. Try changing them into an only aggregations with a SET like this:
Only({<Header=>}Greek_Ind") = '≤'
jonathandienst
Partner - Champion III
Partner - Champion III

In addition to the above, did you try to remove Header from the list of Aggr() dimensions?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
mohan_1105
Partner - Creator III
Partner - Creator III
Author

Hi Vegar,

I tried it as you suggest but there is no luck.. 

I have attached the sample application so you could understand the expression better...

mohan_1105
Partner - Creator III
Partner - Creator III
Author

Hi jonty,

You are correct the Header isn't required in Aggr()..

Thank you..!!

 

Regards,

Mohan

Vegar
MVP
MVP

@mohan_1105 Did the last comment of @jonathandienst solve your issue?
mohan_1105
Partner - Creator III
Partner - Creator III
Author

Nope... It all same even after removing the "Header" field from the expression.