Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis with variable as "filter"

Hello all,

I 've a qlikview dashboard with many metrics that do the same operations but to different fields. To avoid repeating lines of code i organize it with variables with parameters. I am trying to use one of this parameters which is using some calculations but it is not working. Following i pass a sample of how it looks:

THIS IS WORKING:

variables:

vDelivery_CSAT_DSAT = sum({<$1>} $2) / sum({<$1>} FIELD_CSAT_DSAT_TOTAL_FLAG)

vfilter_1= [Region]={'EUROPE'}

vfilter_2= [Region]={'USA'}

Then in the expressions I use it like this:

EXP 1:    $(vDelivery_CSAT_DSAT($(vfilter1),FIELD_CSAT_FLAG))

EXP 2:    $(vDelivery_CSAT_DSAT($(vfilter2),FIELD_DSAT_FLAG))


THIS IS NOT WORKING

What i want and can't accomplish is using in the filter some calculations just like this:


vfilter3 = [DATE]={ ">=$(=addmoths(today(),-12))"}


Nevertheless this works when using it directly in the expression:

sum({<[DATE]={ ">=$(=addmoths(today(),-12))"}>} FIELD_DSAT_FLAG)  /

sum({<[DATE]={">=$(=addmoths(today(),-12))"}>}FIELD_CSAT_DSAT_TOTAL_FLAG)



How could i do it? As said before, i need to do it like this becose there are a lot of metrics that use the same calculations and i want to save code and lines.


Thanks!!

1 Solution

Accepted Solutions
Mark_Little
Luminary
Luminary

Hi

Have you tried it with out the dollar expansions, so

$(vDelivery_CSAT_DSAT(vfilter1,FIELD_CSAT_FLAG))

Mark

View solution in original post

2 Replies
Mark_Little
Luminary
Luminary

Hi

Have you tried it with out the dollar expansions, so

$(vDelivery_CSAT_DSAT(vfilter1,FIELD_CSAT_FLAG))

Mark

Anonymous
Not applicable
Author

Wow! Thank you Mark   1 shot 1 hit!

This totally made the job!