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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vishalgoud
Creator III
Creator III

Which set exp is correct in these ??

1.count({< SE_MARK={1},$1>}DISTINCT SERVICE_ID)   or   count({$1< BASE_MARK={1}>}DISTINCT SERVICE_ID)

- which is correct in above 2 exp

2. var name is  vCustomerBase_Exp

vCustomerBase_Exp = count({< SE_MARK={1},$1>}DISTINCT SERVICE_ID)

$(vCustomerBase_Exp(CHARGE_CODE={'*_RP_*'}))   -- is this correct.

Please respond if any idea on the above, Thanks in advance.

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Your vCustomerBase_Exp is a parameterised 'macro'. the $1 will be replaced buy the first parameter when the variable is expanded with $(.....)


$(vCustomerBase_Exp(CHARGE_CODE={'*_RP_*'})) will expand to

count({< SE_MARK={1},CHARGE_CODE={'*_RP_*'}>}DISTINCT SERVICE_ID)


which is a syntactically valid expression. To evaluate, you may need to nest the expansion

$($(vCustomerBase_Exp(CHARGE_CODE={'*_RP_*'})))


Do not confuse the $1 used for the parameter with $ used as the current selection set in the set expression. The $1 as a set selector in the second expression will use the previous selection. Its like seeing the results of clicking the sections "Back" button.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

7 Replies
karthikoffi27se
Creator III
Creator III

HI Vishal,

The second expression is correct count({$1< BASE_MARK={1}>}DISTINCT SERVICE_ID)

I am not getting your second question

Thanks

Karthik

Anil_Babu_Samineni

For second one, Do you have Parameter analysis?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vishalgoud
Creator III
Creator III
Author

Hi Anil , Thanks for response ,

yes even am also new to project , but CHARGE_CODE there are different records out of which we are taking only those which are having _RP_ in that. hope this is a parameter analysis.

but i suspect that syntactically the below is wrong, can you please help on this.

$(vCustomerBase_Exp(CHARGE_CODE={'*_RP_*'}))   -- is this correct

Anil_Babu_Samineni

What you shown equation that is correct. Instead Single Quote try to use Double Quote?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vishalgoud
Creator III
Creator III
Author

Thanks for the response,

there is no harm using the first one as well right.. count({< SE_MARK={1},$1>}DISTINCT SERVICE_ID) 

this was used in many exp. So just asking ?

jonathandienst
Partner - Champion III
Partner - Champion III

Your vCustomerBase_Exp is a parameterised 'macro'. the $1 will be replaced buy the first parameter when the variable is expanded with $(.....)


$(vCustomerBase_Exp(CHARGE_CODE={'*_RP_*'})) will expand to

count({< SE_MARK={1},CHARGE_CODE={'*_RP_*'}>}DISTINCT SERVICE_ID)


which is a syntactically valid expression. To evaluate, you may need to nest the expansion

$($(vCustomerBase_Exp(CHARGE_CODE={'*_RP_*'})))


Do not confuse the $1 used for the parameter with $ used as the current selection set in the set expression. The $1 as a set selector in the second expression will use the previous selection. Its like seeing the results of clicking the sections "Back" button.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
vishalgoud
Creator III
Creator III
Author

Thank you Jonathan.

if i get you correctly -

there was no syntax errors here

count({< SE_MARK={1},$1>}DISTINCT SERVICE_ID)  - correct one only.

vCustomerBase_Exp = count({< SE_MARK={1},$1>}DISTINCT SERVICE_ID)  results in

                                       count({< SE_MARK={1},CHARGE_CODE={'*_RP_*'}>}DISTINCT SERVICE_ID) which is also correct , Thanks again.