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

Multiply Variable and Field

hello Guys,

I want to multiply a Variable and a Field . Is it possible to do that ?

I have variables set as :- terminal and field as :- hours

I want to multiply these two things as a dimension expression and  show in a data sheet .

=$(v_Terminal)*Hours

This is not working .. Kindly help me with this

Thanks,

ravi

4 Replies
jpenuliar
Partner - Specialist III
Partner - Specialist III

you have to make sure that $(v_Terminal) returns a value

avkeep01
Partner - Specialist
Partner - Specialist

Hi Ravi,

Have you tried NUM($(v_Terminal))*NUM(Hours)?

Probably $(v_Terminal) is causing the issue. Experiment with the following options:

$(=v_Terminal) * Hours

v_Terminal * Hours


Or when the v_Terminal is multiplied with multiple Hour fields, then use a function like SUM.

SUM($(v_Terminal) * Hours)

$(vTerminal) * SUM(Hours)

etc.


Good luck.



Mark_Little
Luminary
Luminary

HI Ravi,

Check the above suggestion's i.e. The variable is returning the value you expect and also the are both numbers.

The next thign you have to take in to consideration is the Aggrations of the Hour field.

You will probably want something like

SUM(Hours)*$(v_Terminal) or SUM(Hours)*vTerminal - Depends on if your variable needs to be evaluated (dollar expanded)

Mark

Anonymous
Not applicable
Author

Thanks Guys,

Will try if it works , Thanks for your kind help