Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am having a dilemma with renaming with IF condition and when I use with some operators (wildmatch) with many IF conditions it works but couple of conditions it doesn't.
Below Yellow highlighted names I want to change it to just "Failed" and "Success"
This is what I tried so far,
=if(wildmatch(event_type, 'AddPasswordSuccess'), 'Success',
if(wildmatch(event_type, 'AddPasswordFailed'),'Failed'))
= if (event_type='AddPasswordSuccess', 'Success',
if(event_type='AddPasswordFailed', 'Failed'))
NON of the above works, BUT below is working for another Dimension
=if(wildmatch(channel_function,'reg-pin*'),'reg-pin',
if(wildmatch(channel_function,'reg-pwd*'),'reg-pwd'))
I dont understand how this Dimensions are similar but one works but the other. Anyone who can help would be really appreciated. Thanks in advance
I have no Idea Why but Used the same expression before,
=if (event_type=('AddPasswordSuccess'), 'Success',
if(event_type=('AddPasswordFailed'), 'Failed'))
But wanted the fields displayed to the "Right" and it is working, But don't understand why not in bottom
It's difficult to see in your image, but it seems your field is named event_typ_name or something like that, but you have just used event_type?
Apart from that, I just want to mention that you could use a simpler expression:
=replace(event_type_name, 'AddPassword', '')
And one last thing: wildmatch is generally used when you need wildcards in the matched phrase, like in your example with channel_function. When you are matching full phrases, you can use match(). I suppose it many times doesn't really matter, but possibly match() evaluates faster than wildmatch().
I suggest to consider to apply such adjustments within the script and/or using multiple fields for it, like ID + NameLong + NameShort as well as various categorizing-measurements - maybe within an extra dimension-table.
Beside this I think your UI approach could be simplified by:
replace(TheRightEventField, 'AddPassword', '')
Thanks @ajaykakkar93 for looking at this, i tested the expression and it did not change the name at all same issue.
Thanks @henrikalmen for taking time to look at it. Sorry the image wasn't clear. Below is more better pic. I tried your Expression : =replace(event_type,'AddPasswordSuccess', 'Success') It did not replace anything or the lable I wanted to change,
Thanks Marcus for your suggestion, I actually don't have access to "Data manger " (Do edit the script) unfortunately. So all I can do is create Variables, Measures and Dimension using Expression to change and implement data given to me.
if you have tried to write your if-expression in the correct place, it would have given you NULL if it didn't work. It would not have given you the original value. So I'm thinking you have written that expression in the wrong place. Can you make an image of also where you have your expression (probably an image of what you master dimension settings are)?
That you have no access to the data-model doesn't mean that's not changeable there - just create such a task for the responsible team. In general should be none renaming be necessary within the UI else all needed fields with the right terminology should be native available.
IMO that's not nice to have else a must because it reduced the development efforts within the UI and saved significantly performance. Further only with native fields you are able to implement advanced views which needs features like aggr() and/or total.
Thanks @henrikalmen You could be right on this as I did the expression doing it here,
Then edited the Expression