Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
i am relatively new to the tool so any help will be much appreciated. I wanna assign a string when a customer code appears 1, between 1 and 5 or a number >5.
The classic excel logic would look like this:
if( [state] = 'payed',
if( count([customer]) = 1, 'One timer',
if( count([customer]) > 1 and count([customer]) < 5, 'Medium user', 'Heavy user')),'')
I know that putting if and a count in this order doen not work here and i could not find a suitable solution between the post i have seen. Can someone give me some suggestion on how to obtain the result?
HI @Power
Try like below
Load yourprimarykeyfield,
if( [state] = 'payed',
if( count([customer]) = 1, 'One timer',
if( count([customer]) > 1 and count([customer]) < 5, 'Medium user', 'Heavy user')),'') as UsrType
Resident ursourcetablename
group by yourprimarykeyfield;
Then in front end, u can use UsrType as ur dimension.
---------------
Suppose, u want to achieve only in front end. try like below
Aggr(if( [state] = 'payed',
if( count([customer]) = 1, 'One timer',
if( count([customer]) > 1 and count([customer]) < 5, 'Medium user', 'Heavy user')),''), UrPrimaryFieldName)
For performance wise, try in backend.
Hi @MayilVahanan,
Thanks for your answer. I tried it, can you specify where should i put it in the editor in order to make it work properly. I couldn't. I am tryin to learn and solve things in different ways. In this particular case i would like not to break the autogenerated code in the editor, so can i put the new variables etc. in a manually generated section and then load the whole script expecting it to work?
Thanks in advance for your time, i know some of my points could sound obvious.