Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Formatting based on the dimension value.

Hi All,

I have a list of KPIs as a dimension. Which have various kinds of metrics like Totals, Costs, Percentages etc. I need to format the data based on the kind. For example, if KPI is related to cost, i need '$ #,###' as format and if Percentage '#.##%' ... using if else .. in the expression will do, but if I have many variations like above, it becomes complicated.

I have tried with keeping a column with the symbols to be added and appended it using (DataValue)&Wildcard. But this fails when the DataValue is null or empty.


Can we achieve this in QlikView? Or else is there any work around.

Thanks in advance.

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Try

= NUM(if(wildmatch(KPI,'Percentage*'),Value/100,Value),Pick(WildMatch(KPI,'Percentage*','Ratio','Total*'),'#.0%','##.0','$##,###'))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

10 Replies
vinieme12
Champion III
Champion III

Hi Shiva,

please post a sample app or sample data, you can format expressions using NUM() function make sure you check expression default in Number tab

https://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/FormattingFunctions/Nu...

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
sarvesh
Creator III
Creator III

Hi..Shiva,

You have to take measure of cost which is numeric value and then you can give the title "Cost" and you can set percentage of achieved from settings.

Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.

This will help users identify the answers should they come across this thread in the future.


Regard's

Sarvesh Srivastava

Anonymous
Not applicable
Author

Dear shiva
find the attach file

Anonymous
Not applicable
Author

Please find the attachment explaining the requirement more clearly. Excuse me for  not being clear in my requirement.

vinieme12
Champion III
Champion III

Try

= NUM(if(wildmatch(KPI,'Percentage*'),Value/100,Value),Pick(WildMatch(KPI,'Percentage*','Ratio','Total*'),'#.0%','##.0','$##,###'))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Thanks Vineeth, But my expression is not as simple, am already using set analysis and if in future if variations increase like (now i have %,$, ratio and if they increase) Adding if else clause for everything makes it hard. Is there work around.

vinieme12
Champion III
Champion III

Yes there is, wait a minute

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

create one expression for each KPI and remove the KPI from dimension, you can then format from Number tab

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

That's a very cool idea Vineeth, but I have around 10 expressions already in my table. Your answer is perfect for a single column. But I think I can't use this approach in my case.