Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
lukas_
Contributor III
Contributor III

Using a measure with set analysis in a variable

Hi,

 

I have difficulties with the insertion of a measure with a set analysis in a measure.

I have a function to format the display of my digits when I associate it with a dual.

 

SET vScaleNumber=If($1> 1000000000,num($1/1000000000, '####,0Mds €')
  ,If($1> 1000000,  num($1/1000000, '####,0M €')
  ,If($1> 1000,  num($1/1000, '####,0K €')
  ,money($1, '####,0 €')
)))

 

 The measure is as follows :

 

dual($(vScaleNumber(
count({<attachement_etat = {'Analysé (conforme)','Réfaction proposee'},prediction_score = {">=$(vSliderScorePrediction)"} >} attachement_id))),
count({<attachement_etat = {'Analysé (conforme)','Réfaction proposee'},prediction_score = {">=$(vSliderScorePrediction)"} >} attachement_id))
)

 

The problem is that when I insert my measure in the function and there is a set analysis with several elements and therefore separated by a comma, my function crashes because it identifies the following as another parameter of the function :

lukas__0-1652714790228.png

I've tried surrounding my count() with $(=) except that's going to calculate the value for me as a whole, so I won't be able to associate it with a dimension.

 

Do you have any idea how to make this work?

 

Thanks

 

Labels (4)
10 Replies
danielrozental
Master II
Master II

Sorry, parameters with commas won't work.

lukas_
Contributor III
Contributor III
Author

Sad, thanks anyway ! 

vinieme12
Champion III
Champion III

you can work around the comas as below

 

count({<attachement_etat = {('Analysé (conforme)'|'Réfaction proposee')}>
*
<prediction_score = {">=$(vSliderScorePrediction)"} >} attachement_id)
Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
lukas_
Contributor III
Contributor III
Author

I'm ok with working around with sets but I can't see how to get the "|" character to work because I have an error :lukas__0-1652774906800.png

 

vinieme12
Champion III
Champion III

my bad, try below

 

 

count({<attachement_etat = {"(Analysé (conforme)|Réfaction proposee)"}>
*
<prediction_score = {">=$(vSliderScorePrediction)"} >} attachement_id)

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
lukas_
Contributor III
Contributor III
Author

This solution partially works. The measure does not take the filter into account if there is a space in the value or a parenthesis. I can replace that with a '*' but it's not very reliable....

vinieme12
Champion III
Champion III

try adding single quotes around the strings, this is basically advanced search and should work

 

count({<attachement_etat = {"('Analysé (conforme)'|'Réfaction proposee')"}>
*
<prediction_score = {">=$(vSliderScorePrediction)"} >} attachement_id)

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
lukas_
Contributor III
Contributor III
Author

This time it does not work at all, I have 0 in result ....

vinieme12
Champion III
Champion III

lets try wildcards

 

count({<attachement_etat = {"(Analysé*conforme*|Réfaction*proposee)"}>
*
<prediction_score = {">=$(vSliderScorePrediction)"} >} attachement_id)
Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.