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

25 Replies
Not applicable
Author

Hi,

Yes I use excatly your expression and still doesn't works.

Please find here a sample,

The Customer pivot uses your expression.

Regards

David

jyothish8807
Master II
Master II

Hi Try this,

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

If you have created variables in variable wizard then put = in the begining of defination.

Regards

KC

Best Regards,
KC
tresesco
MVP
MVP

Check your variables, they are not producing expected output.

ashfaq_haseeb
Champion III
Champion III

yes there is no proper o/p in your variables.

Regards

ASHFAQ

Not applicable
Author

Hi,

Sorry, but I don't understand what you mentioned,

Can you give me an example please ?

Regards

David

Not applicable
Author

Hi KC,

thanks for your proposition but still not working,

the problem is from elsewhere apparently

Regards,

David

ashfaq_haseeb
Champion III
Champion III

Hi,

have a look at attached image.

Regards

ASHFAQ

Anonymous
Not applicable
Author

Hi David,

Please check your variable 'vAndSubFamily' and  'vNotSubFamily'  here when I check these variable in text box then in first variable gives output '$Field' and second gives no data.

Thanks

Not applicable
Author

Hi Dhiraj,

Thanks for your post,

I tried that but still not working :

vNotSubFamily :


=if(count({NOT} distinct SubFamily)<>count({NOT<SubFamily>} distinct SubFamily), //some products selected (but not all) '*' & concat({$*NOT} distinct '<' & vRelevantField & '=E({<SubFamily={' & chr(39) & SubFamily & chr(39) & '}>} ' & vRelevantField & ')>','*',SubFamily), ' <$Field>')

Regards David

Not applicable
Author

ASHFAQ,

Sorry for my bad level ....

I tried that but still not working :

vNotSubFamily :


=if(count({NOT} distinct SubFamily)<>count({NOT<SubFamily>} distinct SubFamily), //some products selected (but not all) '*' & concat({$*NOT} distinct '<' & vRelevantField & '=E({<SubFamily={' & chr(39) & SubFamily & chr(39) & '}>} ' & vRelevantField & ')>','*',SubFamily), ' <$Field>')

Regards

David