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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sspawar88
Creator II
Creator II

Variable Creation

Hi Community,

Here i want to optimize Following line of Code which i have been put into Gauge Chart.

Count({<param_name={'TEMP'},branch_type={'*'},loc_subtype-={'2'},status_subcode-={'1'},param_value={'<=-18'}>}param_value)/

Count({<param_name={'TEMP'},branch_type={'*'},loc_subtype-={'2'},status_subcode-={'1'},param_value={'<=-1'}>}param_value)

is it right,When i Create Variable like:

Set VindPanN='Count({<param_name={'TEMP'},branch_type={'*'},loc_subtype-={'2'},status_subcode-={'1'},param_value={'<=-18'}>}param_value)';

Set VindPanD='Count({<param_name={'TEMP'},branch_type={'*'},loc_subtype-={'2'},status_subcode-={'1'},param_value={'<=-1'}>}param_value)';

& use this in my Expression of Gauge Chart as

$(VindPanN)/

$(VindPanD)

it is not working.

what changes i need to put into variable creation method?

1 Solution

Accepted Solutions
Not applicable

Hi Satish,

remove the opening and closing ' within your set statements and give that a try

Set VindPanN=Count({<param_name={'TEMP'},branch_type={'*'},loc_subtype-={'2'},status_subcode-={'1'},param_value={'<=-18'}>}param_value);

Set VindPanD=Count({<param_name={'TEMP'},branch_type={'*'},loc_subtype-={'2'},status_subcode-={'1'},param_value={'<=-1'}>}param_value);

Joe

View solution in original post

5 Replies
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Satish, if you look in the Variable Overview screen (Ctral + alt + V), what values do you see in these variables?

sspawar88
Creator II
Creator II
Author

Actually i'm working in Qlik sense.

and there is no options like Ctrl+Alt+V in this version.

so that i'm trying to create it at script.

Not applicable

Hi Satish,

remove the opening and closing ' within your set statements and give that a try

Set VindPanN=Count({<param_name={'TEMP'},branch_type={'*'},loc_subtype-={'2'},status_subcode-={'1'},param_value={'<=-18'}>}param_value);

Set VindPanD=Count({<param_name={'TEMP'},branch_type={'*'},loc_subtype-={'2'},status_subcode-={'1'},param_value={'<=-1'}>}param_value);

Joe

marcus_malinow
Partner - Specialist III
Partner - Specialist III

OK, Try This.

the single quotes are causing your expression to be truncated. Replacing with chr(39) (single quote character code) should work

Set VindPanN='Count({<param_name={' & chr(39) & 'TEMP' & chr(39) & '},branch_type={' & chr(39) & '*' & chr(39) & '},loc_subtype-={' & chr(39) & '2' & chr(39) & '},status_subcode-={' & chr(39) & '1' & chr(39) & '},param_value={' & chr(39) & '<=-18' & chr(39) & '}>}param_value)';

Set VindPanD='Count({<param_name={' & chr(39) & 'TEMP' & chr(39) & '},branch_type={' & chr(39) & '*' & chr(39) & '},loc_subtype-={' & chr(39) & '2' & chr(39) & '},status_subcode-={' & chr(39) & '1' & chr(39) & '},param_value={' & chr(39) & '<=-1' & chr(39) & '}>}param_value)';

sspawar88
Creator II
Creator II
Author

Thanks Marcus.