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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variables in Set Analysis

Hi,

I have a table chart with a list of customers highlighting their Gross Profit

For some reason QV has the GPs of each customer exactly the same in my report

However when I specify 1 customer I'm given the correct GP

Here are the details...

I have 2 variables

  • vGP =(sum(calGP)/sum(val))
  • vCurrentFY2 =yearname(today(), 0, 4 )

And this set analysis expression - sum({<[FinancialYear]={'$(vCurrentFY2)'}>}vGP)

Is there a reason why variables will not work in set analysis?

Many Thanks

1 Solution

Accepted Solutions
Not applicable
Author

I used this expression instead to come to a solution, it works now

sum({<[FinancialYear]={'$(vCurrentFY2)'}>}calGP) / sum({<[FinancialYear]={'$(vCurrentFY2)'}>}val)

Thanks for the help.

View solution in original post

3 Replies
khadeer
Specialist
Specialist

first of all check ur variables, its giving correct result r not, n if they r right

try this, just i changed ' to "

sum({<[FinancialYear]={"$(vCurrentFY2)"}>}vGP)

hope it will works

Not applicable
Author

The variables are ok.

If I use this expression I get the completely wrong values

sum({<[FinancialYear]={'$(vCurrentFY2)'}>}calGP/val)

If I change the ' to " I still receive the same results

Not applicable
Author

I used this expression instead to come to a solution, it works now

sum({<[FinancialYear]={'$(vCurrentFY2)'}>}calGP) / sum({<[FinancialYear]={'$(vCurrentFY2)'}>}val)

Thanks for the help.