Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Silly question but really i cannot get the solution

I want to make a calculated dimension based on a value of a variable:

If the value of the variable is null or is not filled I want the normal field and if the variable as a value a want the calculated dimension:

I tried with this :

=if('$(Max)'='' or '$(Min)'='',field1,

if(aggr(sum(W_etc)/SUM(W_etc2),field1)>=$(Min)

and aggr(sum(W_etc)/SUM(W_etc2),field1)<=$(Max)

,field1)

)

What's wrong? Why I get an error if max or min are empty or null ?

Thanks in advance

12 Replies
jvitantonio
Luminary Alumni
Luminary Alumni

Hi try removing '

=if($(Max)='' or $(Min)='',field1,

Not applicable
Author

When the variable is null I get an error on the graph also withot '

jvitantonio
Luminary Alumni
Luminary Alumni

ok, prueba asi:

=if(isnull($(Max)) or isnull($(Min)),field1,

Not applicable
Author

I get: Error in calculated dimension ....

jvitantonio
Luminary Alumni
Luminary Alumni

But if the varible are not null, it works, right?

Not applicable
Author

Neither that solution ... I think the problem is not associated with the IF condition ... but with the field1 passed as dimension

Not applicable
Author

Yes the variable condition works

jvitantonio
Luminary Alumni
Luminary Alumni

so if you onlyu put this

if(aggr(sum(W_etc)/SUM(W_etc2),field1)>=$(Min)

and aggr(sum(W_etc)/SUM(W_etc2),field1)<=$(Max)

,field1)

and the variables are not null, it works?

sebastiandperei
Specialist
Specialist

Hi,

"Null" values are different to "Not Filled" vaules. You must consider both cases:

If (Max='' or Min='' or IsNull(Max) or IsNull(Min), field1....

Take in mind that this condition is only false when Max AND Min has a value...

Please, tell me if it works!!