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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error using Set Analysis with Variable

Hello everyone,

I need your help,

I have some troubles with an expression using set analysis and a variable too.

This is my exprssion in a pivot table :

sum({$ <{$(vAndSubFamily)$(vNotSubFamily)}, Type = 'Actuals' >} [Amount])

$(vAndSubFamily)$(vNotSubFamily) are two succesive products choices

Actuals is a filter on the Sales Type , I have other Types like Budget and Quotations.


Do you know where the error comes from ?


Thank you,

Have a nice day,


David

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Contact me

myskypeID:ashfaqhaseeb

Regards

ASHFAQ

View solution in original post

25 Replies
tresesco
MVP
MVP

The proto-type is like:

Sum({<[Product Choice]={'Product1', 'Product2'}, Type={'Actuals'}>}Amount)

ashfaq_haseeb
Champion III
Champion III

Hi

Try this

sum({$ <{Product={'$(vAndSubFamily)','$(vNotSubFamily)'}, Type = {'Actuals' }>} [Amount])

Make sure to replace it with your original fields.

Regards

ASHFAQ

Not applicable
Author

Hello treseco and ASHFAQ,

Thanks for your really quick response !

My initial expression is : sum({$(vAndSubFamily)$(vNotSubFamily)}Amount)


And actually works, I just add a filter on Type and I have error.

I tried your two suggestions and it's not working with the filter on the Type.

ASHFAQ, is it mandatory to put "SubFamily=" before my variable ? Because it's working without in my initial expression.

Regards

David

ashfaq_haseeb
Champion III
Champion III

Hi,

This is not set analysis

sum({$(vAndSubFamily)$(vNotSubFamily)}Amount)


For set Analysis

You need to go with the above syntax mentioned.


Regards

ASHFAQ

Not applicable
Author

Hi,

I tried,

sum({$ <{SubFamily={'$(vAndSubFamily)','$(vNotSubFamily)'}, Type = {'Actuals'}>} [Amount])

but I have still error on the third curly bracket,

do you have idea why?

Regards

David

ashfaq_haseeb
Champion III
Champion III

Try this

=sum({$ <SubFamily={'$(vAndSubFamily)','$(vNotSubFamily)'}, Type = {'Actuals'}>} [Amount])

Regards

ASHFAQ

Not applicable
Author

You're right,

when I add "=" my error disappear.

But my pivot table still shows nothing.

Regards

David

ashfaq_haseeb
Champion III
Champion III

Hi,

Can you post a sample application to look at.

Regards

ASHFAQ

ashfaq_haseeb
Champion III
Champion III

It was not just =

have a look at your expression

sum({$ <{SubFamily={'$(vAndSubFamily)','$(vNotSubFamily)'}, Type = {'Actuals'}>} [Amount])

Them mine

=sum({$ <SubFamily={'$(vAndSubFamily)','$(vNotSubFamily)'}, Type = {'Actuals'}>} [Amount])


Can you try this and let me know.

If that dosen't work then attach sample.


Regards

ASHFAQ