Skip to main content

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 
Search instead for 
Did you mean: 
Matheus_Zapparoli
Contributor III
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 ?

Thanks in Advance.

Labels (3)
1 Solution

Accepted Solutions
marcus_sommer
MVP & Luminary
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

View solution in original post

6 Replies
marcus_sommer
MVP & Luminary
MVP & Luminary

You may try something like this as dimension:

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

- Marcus

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

marcus_sommer
MVP & Luminary
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

Matheus_Zapparoli
Contributor III
Contributor III
Author

Marcus,

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

- Matheus

marcus_sommer
MVP & Luminary
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

Matheus_Zapparoli
Contributor III
Contributor III
Author

Thanks Marcus!

That solved my problem!