Discussion Board for collaboration related to QlikView App Development.
hi there,
i wonder if its possible to select a value in a field, but instead using the field's value, use an expression that calculates the desired value to be selected...so instead of:
.doc.Fields("Year Quarter").Select "2016Q3"
do something like this:
.doc.Fields("Year Quarter").Select "=(Year(addmonths(vToday,-3))&'Q'&Num(Ceil(Num(Month(addmonths(vToday,-3)))/3)) )"
Any advise ?
Thanks!
PS I should mention that i do not want to use a variable that might contain the desired value...
Hi Philipp, you can try with:
ActiveDocument.Fields("Year Quarter").Select ActiveDocument.Evaluate("(Year(addmonths(vToday,-3))&'Q'&Num(Ceil(Num(Month(addmonths(vToday,-3)))/3)) )")
Just to comment: This sentence can be easily done with actions, consider if you can avoid the use of macros for this.
Hi Philipp, you can try with:
ActiveDocument.Fields("Year Quarter").Select ActiveDocument.Evaluate("(Year(addmonths(vToday,-3))&'Q'&Num(Ceil(Num(Month(addmonths(vToday,-3)))/3)) )")
Just to comment: This sentence can be easily done with actions, consider if you can avoid the use of macros for this.
Each valid expression like: activedocument.fields("Class").select "=count(Member)>200" or valid search-strings like in here: Compound Search - demystified will work. But like Ruben mentioned: try to avoid macros.
- Marcus