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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
yadav_anil782
Creator II
Creator II

variable

Dear Community,

i want to create a variable with given value

variable name = vinflow

and value should be   =Sum({<ACCOUNT_CODE = {"43301","43302","43303",43304"}>}"PERIOD_CR")

i'm trying  this script in variable =if(inflow='Sale of Assets',"=Sum({<ACCOUNT_CODE = {"43301","43302","43303",43304"}>}"PERIOD_CR") but  its not correct

so if i select "Sale of Assets" baton then value should be come according this given logic .

plz share the solution so i can correct this variable

7 Replies
pokassov
Specialist
Specialist

Hi!

variable1:

Sum({$<ACCOUNT_CODE = {43301,43302,43303,43304}>} PERIOD_CR)

variable2:

if(inflow='Sale of Assets',$(variable1))

avinashelite

Hi Anil,

For your information SET ANALYSIS does not work in script you need to do a separate group by calculation in the script and assign this to variable.

Try the same in front end this should work

Not applicable

what do you mean when you say it is not correct?

Below is what I believe will work based on the variable you currently want to define

variable name = vinflow

and value should be   =Sum({<ACCOUNT_CODE = {"43301","43302","43303",43304"}>}PERIOD_CR)

if(inflow='Sale of Assets',$(vinflow))

This follows the other recommendation but is using the variable(s) you have defined

Digvijay_Singh

Your set expression syntax has problem -

=Sum({<ACCOUNT_CODE = {"43301","43302","43303",43304"}>}"PERIOD_CR") should be like -

=Sum({<ACCOUNT_CODE = {"43301","43302","43303","43304"}>}PERIOD_CR)


Avoid double quote if Code is numeric.

yadav_anil782
Creator II
Creator II
Author

Dear Avinas,

surely we can't use script in variable , i was talking about variable value which in need to use for shared button "Sale of Assets"

yadav_anil782
Creator II
Creator II
Author

HI

i'm using this variable for value calculation and this variable working fine

=if(Value='Crores',10000000,if(Value='Thousand',1000,if(Value='Lakhs',100000,if(Value='Millions',100000))))

same this type of variable i want to use for my one analysis  which i shared prviusly  and still i'm stuck on that

=if(inflow='Sale of Assets',=Sum({<ACCOUNT_CODE = {4332"}>}"PERIOD_CR"),

=if(inflow='Intrast received on fd and bank account',=Sum({<ACCOUNT_CODE ={"43301","43302","43303",43304"}>}"PERIOD_CR"),=if(inflow='Return from mutul fund',"=Sum({<ACCOUNT_CODE = {"43302","43303",43304"}>}"PERIOD_CR"),=if(inflow='Loan&Borrowing',=Sum({<ACCOUNT_CODE = {"43302","43303",43304"}>}"PERIOD_CR")

avinashelite

can you please share the sample app with data and output your excepting ...will workout of the same