Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
On one of the tables that I have on the script I got the following calculation:
Load
ID,
LL
Resident XYZ;
On the other hand I have an input box on the tab where the user can enter a value and store in variable VV.
Is there anyway to add a new column in the script to have the following
Load
ID,
LL
LL * Variable(VV) as MM
Resident XYZ.
Thxs,
Alec
Interesting... you want your field to return expression which contains variable... Is it correct?
See this:
LOAD
ID,
LL,
If(ID<>Previous(ID), AA, // returns number
peek('LL') & '+($' & '(VV)/4) +' & Peek('LL')) as MM // returns expression text
RESIDENT XYZ
ORDER BY ID;
You can use the value of the MM field using dollar-sign extension, like $(=MM). Not sure about the details, give it a try.
It will be:
Load
ID,
LL
LL * $(VV) as MM
Resident XYZ;
Hi Michael,
This will not work as the variable is 0 when we load it at first then user will enter an amount on the variable..
Mainly this new field will be dynamic based on the user input..
Thxs,
Alec
Badr,
In this case you shouldn't use it in the load script. Use it in the front end expressions (charts and other places where you can use expressions).
LL * VV
or
LL * $(VV)
Regards,
Michael
Thank you Michael,
I didn't explain it correctly.. it is more complex
On the table I have:
Load
ID,
If(ID<>Previous(ID) and Key - Key2=1,AA,
(peek(LL)+ (Var(VV)/4)) + Peek(LL)) as LL,
Resident XYZ;
I am wondering if i can do this inside a chart instead of on the script?
Interesting... you want your field to return expression which contains variable... Is it correct?
See this:
LOAD
ID,
LL,
If(ID<>Previous(ID), AA, // returns number
peek('LL') & '+($' & '(VV)/4) +' & Peek('LL')) as MM // returns expression text
RESIDENT XYZ
ORDER BY ID;
You can use the value of the MM field using dollar-sign extension, like $(=MM). Not sure about the details, give it a try.
Hi Michael,
This is returning the value in the field as follow 4+$(VV)/4) +4 which is great..
Now I need to present it in a chart so I used the following formula
if(VV)=0,Sum(LL),Sum($(=MM)))
But it is not working..
Let me know your thought and thxs for all your help!
Thxs,
Alec
Could you post your sample app?
Hi,
Attached is a copy of the QVW.
the value that I am trying to show is inside the blue text box. It works only if one Quarter is selected while I needed to work for all of them so i can put it in a chart..
Thxs for your help!
Alec
Hi Any body can help on this..
Thxs so much!
Alec