Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

ashishbhuyekar
New Contributor III

Set Expression - Subtraction using variable

Hi All,

I have below expression which is not giving me proper output.  Here I ma selecting value based on the variable & Installed dimension value & displaying Status.

FirstSortedValue({< Total = {"<=  $(Varible) - [Installed] "} >}[Upgrade Status,-[PathID])

Flow is -

Varibale value will be set from input box  Variable = 20

Value for Installed = 15

So if everything works as expected and will get out put but I am not getting an expected output.

FirstSortedValue({< Total = {"<=  6 "} >}[Upgrade Status,-[PathID])

f i hard code value  as 6 then i am getting output. is anyone able to help in this.

1 Solution

Accepted Solutions

Re: Set Expression - Subtraction using variable

Or this

FirstSortedValue({<Total = {"<=$(=$(Varible) - [Installed])"}>} [Upgrade Status,-[PathID])

View solution in original post

5 Replies
vishsaggi
Esteemed Contributor III

Re: Set Expression - Subtraction using variable

try this

= FirstSortedValue({< [Upgrade Status] = {"$(= Total <= ((vVariable) - [Installed])) "} >} [Upgrade Status], -[PathID])

Highlighted
ashishbhuyekar
New Contributor III

Re: Set Expression - Subtraction using variable

Vishwarath - This is not giving an expected result.

qliksus
Valued Contributor II

Re: Set Expression - Subtraction using variable

Does the field Installed has more than one value?  . why don't you try with some aggregation function like the below

FirstSortedValue({< Total = {"<=  $(Varible) - max([Installed]) "} >}[Upgrade Status,-[PathID])

Re: Set Expression - Subtraction using variable

Hi Ashish,

Try,

FirstSortedValue({< Total = {"<= $(=Varible - [Installed])"} >}[Upgrade Status,-[PathID])

Re: Set Expression - Subtraction using variable

Or this

FirstSortedValue({<Total = {"<=$(=$(Varible) - [Installed])"}>} [Upgrade Status,-[PathID])

View solution in original post