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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
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
Specialist III
Specialist III

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
Specialist III
Specialist III

ok, prueba asi:

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

Not applicable
Author

I get: Error in calculated dimension ....

jvitantonio
Specialist III
Specialist III

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
Specialist III
Specialist III

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!!