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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
felcar2013
Partner - Creator III
Partner - Creator III

set analysis value

hi

i have two variables:

let vTest2 = max(month_ID)

let vTest = fieldname (numeric,1,2,3,4 ...12)

in TextBox, this works: $(vTest2)-$(vTest)

but in set Analysis no

=num(Count({$<month_ID ={"=$(=month_ID)- $(vTest)"}>}distinct customer_id),'#.##0')

i want to deduct both variables, how should i do this?

thanks

felipe

21 Replies
Anonymous
Not applicable

is there only one month_id selected?

in vTest2 you define max(month_id)

try to select ONE month. >Does the set Analysis still is wrong?

avinashelite

we are not able to replicate the issue can you please share the sample data or app

felcar2013
Partner - Creator III
Partner - Creator III
Author

hi

i select always one month and the set is wrong

sushil353
Master II
Master II

hi,

try if this works

=num(Count({$<month_ID ={"=$(=Max(month_ID)- $(vTest))"}>}distinct customer_id),'#.##0')

or

=num(Count({$<month_ID ={'$(=Max(month_ID)- $(vTest))'}>}distinct customer_id),'#.##0')

HTH

Sushil

felcar2013
Partner - Creator III
Partner - Creator III
Author

hi thanks,

i tried that already. QV reads only the first Expression: =Max(month_ID), but not the $(vTest)

Anonymous
Not applicable

you tried to provide a third variable

vNew = vTest2-vTest

and use

the new variable

=num(Count({$<month_ID ={"=$(=(vNew)"}>}distinct customer_id),'#.##0')

felcar2013
Partner - Creator III
Partner - Creator III
Author

data structure is like this ( i cannot use the data)

month_Id,customerID

1,1

1,2

1,3

1,4

1,5

2,1

2,2

2,3

2,4

2,5

2,6

3,1

3,2

3,3

3,4

3,5

3,6

3,7

vTest is a field, to be selected in filter

load * inline [field

1

2

3

4

5

6

7

8

9

10

11

12]

sushil353
Master II
Master II

Hi,

Try this one: =num(Count({$<month_ID ={'$(=Max({1}month_ID)-$( vTest))}>}distinct customer_id),'#.##0')

jfkinspari
Partner - Specialist
Partner - Specialist

What's up with the

let vTest = fieldname (numeric,1,2,3,4 ...12)

The fieldname function requires a field number and a table name.

You could start by replacing it with an integer, and see if that gives you a result of the set expression