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: 
free_anna
Contributor
Contributor

Count with set analysis using variable does not work

I need to count a result of expiration variable from straight table and represent a rating in separated chart

here an example:

Load *INLINE

[

10

20

30

15

22

34

33

];

create variable eTest  IF (SCORE >=30 , 3, if (SCORE>=20 and SCORE <30 ,2, if(SCORE>=10 and SCORE<20,1,0)))

using it in straight table.

Now count rating 2 and 3 and show result in Text object   =count({<eTest={3,2}>}SCORE)

Result is wrong.  It count all position 😞

Any idea how to reuse calculated values from straight tables in chart?

 

 

report_test.qvw.png

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this instead.

Count({<Score = {">=20"}>}Score)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
free_anna
Contributor
Contributor
Author

Thank you for prompt replay.

But real case is more complex , I use a lot of calculation in variable to get the rating.  I will be not able to make total calculation from the Dimension Field to the rating in only one statement...aftersalse.qvw].png

Rating is represent in straight table and I want to summarize a result.

Maybe another idea how to handle it?

jonathandienst
Partner - Champion III
Partner - Champion III

You can't use an expression on the LHS of a set expression - only field names are permitted. You could add the variable logic to the load script to add a derived field, and then use the derived field in the set expression.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sunny_talwar

What is your expression for Score in the straight table?