Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis with expression variable

I have an expression called vMaterialCost wwhcih is a sum of my material costs.  This variable works fine in my expression but we just added a selction criteria called current/Prior month.  In my trending charts, I need to use my vMaterialcost variable as an expression regardless of the value selected in current/prior month

I have tried

=Only({<[Current/Prior Month]={$1} >} $(vMaterialCost))

but that did not seem to work

Assistance is appreciated

1 Solution

Accepted Solutions
sunny_talwar

I think you will have to make the change to your variable itself or just write the whole expression again with the new set analysis. The way you are trying to do won't work.

=Sum({<[Current/Prior Month] = >}[Material Cost Amount])

View solution in original post

5 Replies
sunny_talwar

Can you share your expression for vMaterialCode?

maxgro
MVP
MVP

how is defined vMaterialCost?

to disregard the current/prior month you can use an expression (MaterialCost is a field) as

sum( {$ <[Current/Prior Month]=>} MaterialCost)

Not applicable
Author

sum([Material Cost Amount])

and thsi expression is used throughout the applciation and do not want to change it

sunny_talwar

I think you will have to make the change to your variable itself or just write the whole expression again with the new set analysis. The way you are trying to do won't work.

=Sum({<[Current/Prior Month] = >}[Material Cost Amount])

maxgro
MVP
MVP

If you don't want to change the variable you have to create a new variable with Sunny's expression