Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
vinod2086
Creator II
Creator II

How to exclude % by using set analysis

Hi ,

I have a requirement as below. when i select single id it should take Target Site and when i select Multiple id's it will take Target Aggr.

  i have used mentioned exp

=If(Count([Id])=1,Only(Site_Target),Only(Aggr_Target))

here everything is fine but target Aggr i need to exclude '= ' and '%' (user dont want to see = and %  like insted of =0% i need to display 0, 100,95 so on)

how to write condition.

 

Target SiteTarget Aggr
0=0%
0=100%
0=100%
0=100%
1>=95%
1>=95%

expected output

if it is =0% o/p is 0

         =100% o/p is 1

      >=95% o/p is >=95

5 Replies
prma7799
Master III
Master III

Try like this

=PurgeChar('Aggr_Target','>=%')

marcus_sommer

Maybe with: keepchar(Only(Aggr_Target), '0123456789')

- Marcus

its_anandrjs
Champion III
Champion III

You can use mapping table for this and map with decimal values with its corresponding value and if not found in applymap then use the Null() to fill null value there.

MapTab1:

Mapping Load * Inline

[

Target Aggr, Decimal Value

0%,0

=100%,1

>=95%,0.95

..

..

..

];


Fact:

Load

Applyname('MapTab1',[Target Aggr],Null())

qlik4asif
Creator III
Creator III

HI Vinod,

You can give as PurgeChar('Aggr_Target','=%')


It will omit = and % and give only the values.


If the issue is solved pls mark it as solved


Thanks

Asif

its_anandrjs
Champion III
Champion III

Another approach is KeepChar at script and UI level

Load *,

KeepChar([Target Aggr],'0123456789%') as [Decimal Value],

From .....

Ex:-

Load *,

KeepChar([Target Aggr],'0123456789%') as [Decimal Value] Inline

[

Target Aggr

0%

=100%

>=95%

];