Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i'm working with QlikView 10.
I wonder if it's possible to change the field-formula of a listbox in a macro?
The initial field-formula is =if(aggr(sum(BETRAG_VP) <> 0 , [KONTO_LANG]),[KONTO_LANG])
after button click, the formula should be =if(aggr(sum(BETRAG_LP) <> 0 , [KONTO_LANG]),[KONTO_LANG]) (difference is: BETRAG_VP <> BETRAG_LP).
Unfortunately, i don't know, how to do this. Can anybody help me?
Thanks,
David
Hi David,
I don't think you need a macro here. Put your formula in a variable e.g. vExpression and use the External > Set Variable action within a standard button to change it.
Hope this helps,
Jason
Hi,
This is my offer,pls to see image adjust
Good luck, Luis
Remember that in v10 actions are multi-threaded whereas macros use only a single CPU core. Always best to avoid macros if there's a simple alternative.
Thanks a lot.
So, i combined you two solutions.
the expression is: =if(aggr(sum($(vFieldCost)) <> 0 , [KONTO_LANG]),[KONTO_LANG])
with button click i change the value of vFieldCost.
So, one question: is it possible to use a condition expression for the value attribute under "External > Set Variable action"?
like: =if($(vFieldCost) = 'BETRAG_VP', 'BETRAG_LP', 'BETRAG_VP')
if i used the named condition, qlikview set the variable to "-".
Should be fine to do that. Can you post your qvw and I'll take a look?
Jason
jo, i created a demo project with the same behavior
Hi,
This is my offer,pls to see image adjust
Good luck, Luis
hey,
that's working very fine.
Thanks a lot!
David
Yep - Luis's solution is what I would also advise. Always try to use the native functionality if possible!