Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create categorization list

Dear all,

I'm quite new in qlik, and, as you may suppose, I have some problem and I'm not able to manage with this. The issue concern conversion from numerical value into text/list needed to fliter.

Below statement return number between search position:

only({<[promo_result.provider]={'skyscanner.pl'},Match={'T'},OstatniaOdpowiedz={'T'}>}[promo_result.position])

-

only({<[promo_result.provider]={'REGULAR'},Match={'T'},OstatniaOdpowiedz={'T'}>}[promo_result.position])

But it's a measure.

What I'd like to do is a categorisation which based on the results of the difference. I thought that I managed in this case that way:

1. Create a text variable:

Text(only({<[promo_result.provider]={'skyscanner.pl'},Match={'T'},OstatniaOdpowiedz={'T'}>}[promo_result.position])

-

only({<[promo_result.provider]={'REGULAR'},Match={'T'},OstatniaOdpowiedz={'T'}>}[promo_result.position]))

named Position_diff_aggr

2. Use 'if' statement to create a filter list:

if ($(Position_diff_aggr) =0 ,'0',

if($(Position_diff_aggr) > 0 and $(Position_diff_aggr) <= 3,'between 1-3 position'

,

if($(Position_diff_aggr) > 3 and $(Position_diff_aggr) <= 7, 'between 4-7 position'

,

if($(Position_diff_aggr) > 7 and $(Position_diff_aggr) <= 11, 'between 8-11 position'

,

if($(Position_diff_aggr) > 11 and $(Position_diff_aggr) <= 15, 'between 12-15 position'

,

if($(Position_diff_aggr) > 15 and $(Position_diff_aggr) <= 20, 'between 16-20 position'

,

if ($(Position_diff_aggr) > 20 ,'greater than 20'

)))))))

But the result of the second step didin't work as a dimension but still as a measure, so I can not use it as a filter.

Do you have any ideas how to managed with this issue ?

All ideas will be helpful for me, cause I have no idea why Qlik doesn't work in my case.

BR,

Ola

2 Replies
marcus_sommer

If you could use a equally bucket-size you could use a calculated dimension like:

=class(aggr($(Position_diff_aggr), Dim1, Dim2), 3)

If not you could use something like this:

pick(match(aggr(floor($(Position_diff_aggr)), Dim1, Dim2), 0,1,2,3,4,5,6,7,8,....),

     dual('0', 1),

     dual('between 1-3 position', 2), dual('between 1-3 position', 2), dual('between 1-3 position', 2),

     dual('between 4-7 position', 3), dual('between 4-7 position', 3), dual('between 4-7 position', 3),

     dual('between 4-7 position', 3), ....)

See also: Calculated Dimensions

- Marcus

Anil_Babu_Samineni

What is this Problem, Can you please post expression on wall

Position_diff_aggr

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful