Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
If you are a Qlik Insight Bot user, join this collaborative group: JOIN GROUP
Highlighted
Not applicable

How to show % values using class function

Hi,

i need  to show  in the class  function the values in % like 10% <=x< 20%.

The formula that I use is:

=class(round(aggr(count({<ID_FactSource={'ARIANNA'}>}distinct ID_FAT_DATA_FILE)

/

count({1<ID_FactSource={'ARIANNA'}>} distinct total ID_FAT_KEY_FILE), ID_FAT_C_Committente_Originale), .1), .1)

I got the values like 0.1<=x<0.2 and so on.

Any idea?

Thanks!

Andrea

4 Replies
Highlighted
Not applicable

Re: How to show % values using class function

Hello,

You can use the num() function, with your own number format (here, the %).

num(

class(round(aggr(count({<ID_FactSource={'ARIANNA'}>}distinct ID_FAT_DATA_FILE)

/

count({1<ID_FactSource={'ARIANNA'}>} distinct total ID_FAT_KEY_FILE), ID_FAT_C_Committente_Originale), .1), .1)

,'# ##0%')

Regards,

Amand

Highlighted
Valued Contributor II

Re: How to show % values using class function

Hi,

Amand was on the right way,

But to be sure on your numeric format, I advise you to enter the last parameters (decimal and thousand separators) like this :

num( 
class(round(aggr(count({<ID_FactSource={'ARIANNA'}>}distinct ID_FAT_DATA_FILE)
/
count({1<ID_FactSource={'ARIANNA'}>} distinct total ID_FAT_KEY_FILE), ID_FAT_C_Committente_Originale), .1), .1)
,'#,##0.%','.',',')

Hope that helps you,

Martin

Highlighted
Not applicable

How to show % values using class function

Hi,

better but not as I want to have. I got only one value 80%, 70%, etc. not 80%<=x<90%.

Any more idea?

Thanks!

Highlighted
Valued Contributor II

Re: How to show % values using class function

However,

You have to do this :

floor(aggr(count({<ID_FactSource={'ARIANNA'}>}distinct ID_FAT_DATA_FILE)

/

count({1<ID_FactSource={'ARIANNA'}>} distinct total ID_FAT_KEY_FILE), ID_FAT_C_Committente_Originale), .1)

& ' <= x < ' &

ceil(aggr(count({<ID_FactSource={'ARIANNA'}>}distinct ID_FAT_DATA_FILE)

/

count({1<ID_FactSource={'ARIANNA'}>} distinct total ID_FAT_KEY_FILE), ID_FAT_C_Committente_Originale)+0.1, .1) as MyField

Hope that helps you,

Martin