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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use an expression, without display it in graph

Hi !

When I'm developing my QV application, I use a graph (table) having many expressions like this :

Exp1 = a long expression
Exp2 = a very long expression
Exp3 = a very very long expression
TOTAL = [Exp1] + [Exp2] / [Exp3]

This allows me to verify that every step of my formula are right.

But for the production, I don't want to display the "Exp1", "Exp2" and "Exp3", only the "TOTAL" is interesting.

I would like to hide the columns, but I want the expressions still calculated.

If I uncheck "active" on an expression, the column is no more displayed, but the value of "[Exp1]" has no more value, so the "TOTAL" column is false.

My only solution is to replace


TOTAL = [Exp1] + [Exp2] / [Exp3]


by


TOTAL = a long expression + a very long expression / a very very long expression


but it's not really "human readable".

Is there a solution to have an expression active but hidden ?

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

and if you define your expressions as variables like:

SET varEXP1 = YourLongExpression;

Rainer

View solution in original post

6 Replies
Not applicable
Author

Hi,

if you have a straight table go to properties and "Hide Column".

Good luck!

Rainer

Not applicable
Author

Unfortunately, I'm using a "cross table".

Not applicable
Author

Hi,

and if you define your expressions as variables like:

SET varEXP1 = YourLongExpression;

Rainer

Not applicable
Author

OK.

It was what I though at first, but after a quick try, it didn't worked and I made this post.

Since you said the same thing, I tried depper. After several tries (SET / LET / with quotes / without quotes / =[VARNAME] / =$([VARNAME] / ...), I found the correct syntax.

In my load script, I set for instance :


SET [TEST Toto] = if(varCountMois = 1, sum({$} [Cumul Marché]), '-');


(no quotes surrounding the expression)

In my graph, I use :


=$(#TEST Toto)


(no brackets !!!)

And the result is fine.

Thank you ! Yes

Not applicable
Author

This solution does not work everytime.

If in my graph, I set the following expression :

=sum({$<[Year]={$(#=Only(Year)-1)}>} [Incoming])
, I have a correct value displayed.

If in my script, I set the following variable :

SET varFooBar =sum({$<[Year]={$(#=Only(Year)-1)}>} [Incoming]);
and in my graph
=$(varFooBar)
I have no more values displayed.

I think there is a problem where I use other variables / formulas in my formula.

Not applicable
Author

I found I have to set my variables not in the loading script, but in the properties of the document.