Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Zapparoli
Creator II
Creator II

Sorting Text and Number in calculated Dimension

Hello, i'm having trouble in sorting my dimension in QlikView.

My Calculated Dimension is: =if (WildMatch([Companies], 'Company*') = 1, 'Company A', 'Company B') & ' ' & [WeekNumber]

In the attached file, you can see the result.

What i want to achieve is sorting the Week for Both company A and B for them  be side by side.

Company A 17 

Company B 17

Company A 18

Company B 18

etc...

I have Tried in the Order tab using WeekNumber as a expression, but it did not work.

What i could possibly do ?

Thanks in Advance.

Check my Youtube Channel for more Qlik Content
https://www.youtube.com/@ZappaAnalytics

Labels (3)
1 Solution

Accepted Solutions
marcus_sommer

Ok, then try it in this way:

dual(
if(WildMatch([Companies], 'Company*') = 1, 'Company A', 'Company B') & ' ' & [WeekNumber],
[WeekNumber] + if(WildMatch([Companies], 'Company*') = 1, 0.1, 0.2))

- Marcus

View solution in original post

6 Replies
marcus_sommer

You may try something like this as dimension:

dual(
if(WildMatch([Companies], 'Company*') = 1, 'Company A', 'Company B') & ' ' & [WeekNumber],
[WeekNumber])

- Marcus

Zapparoli
Creator II
Creator II
Author

Hello Marcus!

That almost worked!

The values got sorted Correctly, but i can only see Company B now.

Company B 17 - Bar One: 553,23
                                 Bar Two: 222,21

Company B 18 - Bar One: 491,16
                                 Bar Two: 239,01.

I'm suspecting my IF condition broke somehow, but i'm not really sure.

 

Thanks!

Check my Youtube Channel for more Qlik Content
https://www.youtube.com/@ZappaAnalytics

marcus_sommer

Of course, it couldn't work because I missed to set the numeric part of the dual() properly - therefore change it to:

dual(
if(WildMatch([Companies], 'Company*') = 1, 'Company A', 'Company B') & ' ' & [WeekNumber],
[WeekNumber] * 100 + if(WildMatch([Companies], 'Company*') = 1, 1, 2))

- Marcus

Zapparoli
Creator II
Creator II
Author

Marcus,

With that change, the Graph became the same as it was in the first picture i uploaded.

- Matheus

Check my Youtube Channel for more Qlik Content
https://www.youtube.com/@ZappaAnalytics

marcus_sommer

Ok, then try it in this way:

dual(
if(WildMatch([Companies], 'Company*') = 1, 'Company A', 'Company B') & ' ' & [WeekNumber],
[WeekNumber] + if(WildMatch([Companies], 'Company*') = 1, 0.1, 0.2))

- Marcus

Zapparoli
Creator II
Creator II
Author

Thanks Marcus!

That solved my problem!

Check my Youtube Channel for more Qlik Content
https://www.youtube.com/@ZappaAnalytics