Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everybody,
Today i got a problem with qlik,
I created i variable $(POC) that can take to value :'Yes' or 'No'
now i'm tryng use this variable to count a flied called 'Poche' when $(POC) = 'Yes'
so it'll count the number of 'poche' when $(POC)='Yes'.
my syntax is like that : count({<$(POC)={'Yes'}>} [Poche])
and it dosent work ! Somebody have a solution please ?
Thanx you
If $(POC) is an expression, can you try with
Count({<Poche={"=$(POC)='Qui'"}>} Poche)
With the assumption that the = sign is not included in your variable POC. Also $ sign expansion is only evaluated at chart level, so not per row level of the dimension.
I think what you want is something like this:
=Count({<Poche = {'$(POC)'}>}[Poche])
Thx Sundidia for your answer,
But no, i want to count the number of 'poche' (it can be one,two or five for example ) when my variable $(POC)='Yes'.
you understand.?
thanks?
If I understand your correctly, try one of these:
1) =If(POC = 'Yes', Count(Poche)) or
2) =If($(POC) = 'Yes', Count(Poche))
HTH
Best,
Sunny
I tried your solution, the syntax is good but is not exacly the solution, i explain you again
Each 'poche' has his $(POC) value ('Yes' or 'No'),and I want to count the number of poche that has a his $(POC)= 'Yes'
thanks you very much
Is $(POC) a field or a variable? If it is not a field, then how does each Poche has its own $(POC)??? Do you have a sample that you can share??
Sunny
here is a example, 'Yes' = 'Oui', No='Non', in this case , i want from my calculeated epression 1 as result
'(POC)' fields containt my variable $(POC).
Hope u understand better know, thanx
count({$<[(POC)]={'Oui'}>} [Poche])
Marco Wedel not sure if (POC) is a field or an expression label. From the image it seems Expression to me, but I may be wrong.
As I understand, you have a field called (POC) and a variable POC (be aware that $() is used for a so called dollar sign expansion of a variable, check the HELP for more details). A variable in QV is not connected to the data model.
Or are you referring to field (POC) as a variable (which some do, in a more statistics based context)?
If you have a variable and a field, try
=COUNT({$<[(POC)] = {'$(POC)'}>} [Poche])
or a distinct count:
=COUNT({$<[(POC)] = {'$(POC)'}>} DISTINCT [Poche])