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: 
naveen341
Creator
Creator

Set Analysis is not working using Varaiable

HI Team

I Have  a value in the field and value in a varaible i am trying to write and set analysis to see if one value is greater than other its not working

can you please help me with this

 

HGB_VAL=8.7

$(vHGB)=5

count the Unique_Blood_Unit

formulae i have written is 

=count( {<HGB_VAL={">=$(vHGB)"}>} Unique_Blood_Unit

 

Thanks In Advance

 

 

Labels (1)
6 Replies
rubenmarin

Hi, HGB_VAL should be realted with data to apply filters, ie:

SET vHGB=5;

Data:
LOAD * Inline [
HGB_VAL, Unique_Blood_Unit
8.7,2
4,1
];

"count( {<HGB_VAL={">=$(vHGB)"}>} Unique_Blood_Unit" returns 1
"sum( {<HGB_VAL={">=$(vHGB)"}>} Unique_Blood_Unit" returns 2
naveen341
Creator
Creator
Author

it is realted to data

 

rubenmarin

HGB_VAL is left-aligned, it means it's beign oinnterpreted as a string not a number,

Try converting it while loading:
LOAD
Num#(HGB_VAL,'.',',') as HGB_VAL,
...
naveen341
Creator
Creator
Author

NO This did not help

 

Shubham_Deshmukh
Specialist
Specialist

Naveen,

It is working in my case, just check your expression
vHGB= 5;

=count( {<HGB_VAL={">=$(vHGB)"}>} Unique_Blood_Unit)

 

Regards

rubenmarin

To make it work HGB_VAL should be a number, to convert a string to a number you can use Num#(), the exact sentence needed may vary based on your local settings for numbers, try different parameters for Num#():
https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/Scripting/In...

You can try until this expression returns a number: Max(Num#(HGB_VAL,'.',','))+1