Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vvira1316
Specialist II
Specialist II

need help with managing variation of similar set analysis expression for maintainability, performance

Hi,

I've a set of set analysis expressions that are my main expressions. I've included one of them here. Then I've variation of main expression that I've to use in straight table either to perform a calculation or for another data point. I've included several expressions below. I've included several screen shots of charts where I'm using them to provide some reference.

I'm trying to get help/guidance to see if those can be leveraged using a single variable (Multiple variables ???) for maintainability and performance. The reason I say maintainability is because it is possible that business may change logic of main expression in future. At that time I want to avoid changing logic everywhere

Main Expression for which a variable is created.

Count({<[Field_DocStat]={'NR'}, [Field_IsDFDoc]={'No'}, [Field_SDT]-={'Val1', 'Val2'}>}[Field_CPDID])

I've variable (vNewRequest) created for above expression that I'm using in objects on multiple tabs for example

=If($(vNewRequest)>=1,$(vNewRequest),Null()) in Chart 1 (refer to screen shots)

Other Expressions where variations of Main Expression is use for different calculation or data point values

expression 2

=Today() - Max({<[Field_DocStat]={'NR'}, [Field_IsDFDoc]={'No'}, [Field_SDT]-={'Val1', 'Val2'},  [Field_CPDID]>}[ReqDate])

expression 3

='SF - ' & MaxString({<[Field_DocStat]={'NR'}, [Field_IsDFDoc]={'No'},[Field_SDT]-={'Val1', 'Val2'}, [Field_CPDocID]>}[Field_CPDID]) &
Chr(60) & 'URL' & Chr(62) & 'https://weburl' &
MaxString({<
[Field_DocStat]={'NR'}, [Field_IsDFDoc]={'No'},[Field_SDT]-={'Val1', 'Val2'}, [Field_CPDID]>}[Field_CPDocID])
& 'weburlparamstr'

expression 4

=If(IsNull(MaxString({<[Field_DocStat]={'NR'}, [Field_IsDFDoc]={'No'},[Field_SDT]-={'Val1', 'Val2'}, [Field_CPDID]>}[FNDocURL])),'',
'FN - ' & MaxString({<
[Field_DocStat]={'NR'}, [Field_IsDFDoc]={'No'},[Field_SDT]-={'Val1', 'Val2'}, [Field_CPDID]>}[FNDocURLLink]))

Question2QlikComm.png

Question2QlikComm2.png

I hope my question makes sense. Let me know if any additional information or more clarification is required

Regards,

Vijay

3 Replies
sunny_talwar

May be this can help:

Variables with Parameters

vvira1316
Specialist II
Specialist II
Author

Sunny,

Thanks a lot for guiding me to that post. Very helpful.

UsingParametrizedVariable.png

Param1.png

Param2.png

Param3.png

Param4.png

sunny_talwar

Sweet