Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Wildcard in a calculated dimension

I want to create a group for a chart. My field for the dimension is

[Section Code] and I want to have the group contain anything that starts with a 1 and then create a group for anything that starts with a 2, 3,etc.

Is this possible?

1 Solution

Accepted Solutions
aarkay29
Specialist
Specialist

This may be in the script

If(Left([Section Code],1)='1','100',

    If(Left([Section Code],1)='2','200',

          If(Left([Section Code],1)='3','300',

          )

     )

)          as Grouping

View solution in original post

7 Replies
vishsaggi
Champion III
Champion III

Can you show us some sample data and expected output? You want the groups created in Script ?

Not applicable

create cyclic or drill down group like ...

having below calculated dimensions

wildmatch(dim,'*1*')

wildmatch(dim,'*2*')

evansabres
Specialist
Specialist
Author

[Section Code]

101

102

103

104

So I would want to group those together in a group called 100 Level

In script would be better than in chart, yes, thank you.

marcus_sommer

Maybe something like: left([Section Code],1) where it might be more suitable to create this kind of categories within the script.

- Marcus

marcus_sommer

If I look on your last example something like: ceil([Section Code] / 100) * 100 might work better as string-functions.

- Marcus

aarkay29
Specialist
Specialist

This may be in the script

If(Left([Section Code],1)='1','100',

    If(Left([Section Code],1)='2','200',

          If(Left([Section Code],1)='3','300',

          )

     )

)          as Grouping

vishsaggi
Champion III
Champion III

Try this:

LOAD *, IF(WildMatch(SectionCode, '1*'), SectionCode) AS [100 Level],

        IF(Not WildMatch(SectionCode, '1*'), SectionCode) AS [Level2]

         INLINE [

SectionCode

101

102

103

104

105

107

201

203

204

300

330

340

350

];