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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Noor51
Creator
Creator

How to to have multiple format on a graph?

Hello, 

I'm trying to format a graph with multiple formats. I have tried to custom format that doesn't work for GP%. I tried also formatting in the expression, but it didn't work as well. What is the best way to format for these button for a graph?

Noor51_0-1682361056277.png

 

Labels (1)
1 Solution

Accepted Solutions
Sabrina_V
Partner - Creator II
Partner - Creator II

You have multiple buttons that need to change the format of the indicator and the indicator right?

Why don't you use a variable ?

I explain my idea : 

  1. Create a variable vKPI
  2. Each button will change the value of the variable vKPI
  3. in the formula of the measure : use a pick match function to switch between the formula 

Link Pick

View solution in original post

3 Replies
edwin
Master II
Master II

this isnt clear to me, are you trying to format a button or using the button to format a chart?  also what format did you want? format numbers or format colors?
to give you an idea, if you want for eample different number formats, you can store the format in a variable.  you can also store colors in a variable and use that in your format

you may need to explain what you are trying to achieve in more detail

Noor51
Creator
Creator
Author

Hello, 

I'm using the button to format a chart in a number format such as Sales ($###,###), percentage (%##), Units (###,###), and price ($##.##).

Here is what I have written in Qlik sense which the formatting is not working. 

pick(vDashboard,

//Units
    Num(
if(
        (Sum({<Scenario={'Preliminary Forecast'},[MoYear] = {">=$(vX)"}>}Units))
    = 0, 
        Null(),           
(Sum({<Scenario={'Preliminary Forecast'},[MoYear] = {">=$(vX)"}>}Units))),'###,###,###'),
//Net Sales
Num(
if(
        (Sum({<Scenario={'Preliminary Forecast'},[MoYear] = {">=$(vX)"}>}[Net Sales])),'$###,###,###')
    = 0, 
        Null(),
(Sum({<Scenario={'Preliminary Forecast'},[MoYear] = {">=$(vX)"}>}[Net Sales]))),'$###,###,###',
//GP
Num(
if(
        (Sum({<Scenario={'Preliminary Forecast'},[MoYear] = {">=$(vX)"}>}[GP]))
    = 0, 
        Null(),
(Sum({<Scenario={'Preliminary Forecast'},[MoYear] = {">=$(vX)"}>}[GP]))),'$###,###,###'),
//GP% 
Num(
Sum({<Scenario={'Preliminary Forecast'},[MoYear] = {">=$(vX)"}>}[GP])
/
Sum({<Scenario={'Preliminary Forecast'},[MoYear] = {">=$(vX)"}>}[Net Sales]),'0.0%'), 

//ASP
Num(
Sum({<Scenario={'Preliminary Forecast'},[MoYear] = {">=$(vX)"}>}[Net Sales])
/
Sum({<Scenario={'Preliminary Forecast'},[MoYear = {">=$(vX)"}>}Units),'$#.##'), 

//ACP
Num(
Sum({<Scenario={'Preliminary Forecast'},[MoYear] = {">=$(vX)"}>}[GSNOC]) 

Sum({<Scenario={'Preliminary Forecast'},[MoYear] = {">=$(vX)"}>}Units),'$#.##'), 
)

Sabrina_V
Partner - Creator II
Partner - Creator II

You have multiple buttons that need to change the format of the indicator and the indicator right?

Why don't you use a variable ?

I explain my idea : 

  1. Create a variable vKPI
  2. Each button will change the value of the variable vKPI
  3. in the formula of the measure : use a pick match function to switch between the formula 

Link Pick