Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Selection of work centers in script

Hi

I have a lot of work centers in my file: PM-TECH, PM-PRO, PM-OFF, AM-SLIT, AM-DOCT and many more.

I want to use work center as dimension in a chart but I want to filter out PM-TECH and all that starts with AM.

Can i do like this in my script?

IF([Main WorkCtr]='PM-TECH','PM','AM') as Workcenter

Will it work so it's not counting with PM-PRO and PM-OFF, only PM-TECH and all AM?

Best regards

/Mats

1 Solution

Accepted Solutions
Sokkorn
Master
Master

Hi Mats,

Can you try this again

=If(WildMatch(Workcenter,'*AM*'),'AM',

    If(Workcenter='PM-TECH','PM',Null()))

Regards,

Sokkorn

View solution in original post

11 Replies
tresesco
MVP
MVP

you can use Calculated Dimension in the front end. use expression:

IF([Main WorkCtr] not LIKE 'AM*' or [Main WorkCtr] <>'PM-TECH', [Main WorkCtr])

Thanks.

oleg_orlov
Creator
Creator

Hi!

Try something like that:

Sum ({$<WorkCenter = WorkCenter - {'PM-TECH'} - {"AM*"} >} 1)

Not applicable
Author

Hi all and thanks for your (very quick!) answers.

I have tried them all with or without more or less success...

I get something like this in my graph:

2013-05-30 10-06-13.jpg

but i would like it to be like this:

2013-05-30 10-12-32.jpg

Just a difference between PM-TECH (PM-PRO and the other PM's should not count) and all AM together.

My expression is clear so i don't want to touch that, it must be done in the script or in the dimension.

/Mats

Sokkorn
Master
Master

Hi Mats,

Did you try "Calculated Dimension" yet? In your pie chart use this calculated dimension

=If(WildMatch(Workcenter,'*AM*','AM',

    If(WildMatch(Workcenter,'*PM*','PM')))

Regards,

Sokkorn

Not applicable
Author

Hi

I get an error if i try this

2013-05-30 10-46-12.jpg

I have tried to put in ,1 and ,0 where the mark is but then my chart is all black.

It looks fine when i do like i described from the start;

 

IF

([Main WorkCtr]='PM-TECH','PM','AM') as Workcenter

but i im not sure if it's showing the right result.

/Mats

oleg_orlov
Creator
Creator

= if (WildMatch (Workcenter, 'AM*') > 0,

      'AM',

      if (WildMatch (Workcenter, 'PM*') > 0,

          'PM',

          'Others'

      )

  )

Sokkorn
Master
Master

Hi Mats,

Oop sorry my fault.

Use this one

=If(WildMatch(Workcenter,'*AM*'),'AM',

    If(WildMatch(Workcenter,'*PM*'),'PM'))

Regards,

Sokkorn

er_mohit
Master II
Master II

Try this

if(pick(WildMatch(Workcenter,'*AM*'),'AM') or

    pick(WildMatch(Workcenter,''PM-TECH'),'PM'),Workcenter)

Not applicable
Author

Hi and thx.

This works but the problem is that all PM is counted. It is just the workcenter with the name 'PM-TECH' that should be accounted for.

/Mats