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
felcar2013
Partner - Creator III
Partner - Creator III
Author

Not working. vNew works, but not in the set Analysis expression

sushil353
Master II
Master II

if vnew is working then this should work: =num(Count({$<month_ID ={'$(vNew)'}>}distinct customer_id),'#.##0')

if this wont work then share ur sample app.

felcar2013
Partner - Creator III
Partner - Creator III
Author

this works, when using the field month_ID directly:

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

when using a Trigger in another field "month_text", toggle select month_ID, it does not work any more.

avinashelite

This statement wont work in the script :

let vTest2 = max(month_ID)

if you want the max then you need to do a group by on the key field otherwise it wont fetch the max value.

can you please share the your app??


felcar2013
Partner - Creator III
Partner - Creator III
Author

it fetches the max value.  as said, this formula worked num(Count({$<month_ID ={$(=max(month_ID)-$(vTest))}>} distinct customer_id),'#.##0')

the issue is also, that i am using two fields as filter

month_text (names of months and year)

month_ID used in formula

in the UI the user shall select a month from the filter month_text and the value selected shall activate the month_ID field (in the Background). The month_ID value is used in the Expression. I used for this toggle select on the field month_text and activated the month_ID, which works correctly, however, the selected month_ID is not activating the Expression. To activate the Expression i Need to select directly the month_ID, what is what i do not want.

i cannot share my app (more than 700 millions, but the data I submitted previously reflects the data structure.

jfkinspari
Partner - Specialist
Partner - Specialist

What is the relationship between the fields month_text and month_ID?

When you selects a value in month_text and the actions does it's thing on Month_ID, how do the Month_ID listbox then look?

felcar2013
Partner - Creator III
Partner - Creator III
Author

hi, it Looks like this

month_id, month_text

90,Jul.2015

89,Jun.2015

88,May.2015

.......

bis Jan.2011

jfkinspari
Partner - Specialist
Partner - Specialist

All right,

It's unclear why a selection in month_id performs differently than a selection in month_text, as the relationsships seems to be 1:1 based on Graphics above.

When you select a single value in month_text, is more that one month_id then possible?

felcar2013
Partner - Creator III
Partner - Creator III
Author

in the User Interface i use the filter "month_text" and the user selects, for example Jul.2015, then in the Expression i use the "month_ID" field.

this means, when the user selects Jul.2015, the field "90" is selected. For this i used toggle select as Trigger on the field "month_text". The value "90" is selected (green), but the Expression does not work.

felcar2013
Partner - Creator III
Partner - Creator III
Author

no, this is not possible