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

Need help in a Expression

Hello Friends,

Trying to create a pivot table with two dimentions Actor, Movies and the expression is as followed

=If(Title='Movies' and Actor='Tom',Sum({<CM={'Cinema'}>}Collection)), which is working fine but

my requirement is, I would like to see all Actors like {*}, not only for the actor 'Tom.

As I don't know how to write a expression.

Could you please help me on this.

Regards

Chriss

5 Replies
Not applicable
Author

Hi,

what happens if you dont include that filter at all.

=If(Title='Movies' ,Sum({<CM={'Cinema'}>}Collection))

Thanks

Not applicable
Author

Hello Umesh,

Thanks for your reply,

The Title Movies is a hard coded using INLINE funtion and Actor is a field name in a table, the problem is when I add the Actor in a dimention.

 

No values is shown, that is my problem, If I try like this as in the below

 

=If(Title='Movies' and Actor='Tom',Sum({<CM={'Movies'}>}Collection)), I can achieve it but only for Actor Tom,

I would like to show all Actors.

Hope I am clear.

Regards

 

Chriss

SunilChauhan
Champion II
Champion II

Try below code

Sum({<CM={'Cinema'},

Actor={*},Title={'Movies'}>}Collection))

or

if all movies

Sum({<CM={'Cinema'},

Actor={*},Title={*}>}Collection))

hope this helps

Sunil Chauhan
Not applicable
Author

Hello Luminary Sahatwar,

Thanks for your reply, I can do this if I have only one expression, but I need to use diffently like

=If(Title='Movies' and Actor='Tom',Sum({<CM={'Movies'}>}Collection)),

if(Title='Drama' and Actor={*}, Sum({<CM={'Drama'}>}AuditoCollecion)),

if(Title='Dance' and Actor={*}, Sum({<CM={'Drama'}>}TheatreCollection)),..... up to n.

How to do this.

Regards

Chriss

Not applicable
Author

Chris,

could you please let us know the data structure that you are using. It will be helpful if you paste the sample data here.

Thanks