# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for
Did you mean:
Contributor III

## 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 ?

Labels (3)

• ### week

1 Solution

Accepted Solutions
MVP & Luminary

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

6 Replies
MVP & Luminary

You may try something like this as dimension:

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

- Marcus

Contributor III
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!

MVP & Luminary

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

Contributor III
Author

Marcus,

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

- Matheus

MVP & Luminary

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

Contributor III
Author

Thanks Marcus!

That solved my problem!

Community Browser