Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to count all the actions where the code starts with a P,
the P is followed by different numbers.
What is incorrect in my expression?
count(distinct if(match(project_actions_code,'P%'),action_id))
Match tells if P is contained in the string, use this expression instead:
count(distinct if(Index(project_actions_code,'P')=1,action_id, null()))
or
count({$ <project_actions_code={'P%'}>} distinct action_id)
let me know
Match tells if P is contained in the string, use this expression instead:
count(distinct if(Index(project_actions_code,'P')=1,action_id, null()))
or
count({$ <project_actions_code={'P%'}>} distinct action_id)
let me know
The code starts with a P or an A followed by numbers.
I only want to count the actions where the code starts with a P, without regard wich numbers follow the P
Ok, what about the code I sent to you?
Replace % by *
count({$ <project_actions_code={'P*'}>} distinct action_id) is the most efficient,
set analysis is more efficient than if clauses,
cheers
The first expression works!
The second one only gives me zero's.
It solved my problem, thanks!
Unfortunatly the set analysis doesn't work, the if-analysis does work