Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
jadams123
Creator
Creator

Label Question

So I have a label column (this is WTD sales)

= 'Sales ' & max(total Year) & chr(10) & 'Week ' & max(TOTAL [Week No])

I have a second label (This is WTD Budget)

= 'Budget Sales ' & max(total Year) & chr(10) & 'Week ' & max(TOTAL [Week No])

I basically want to divide these two numbers.

I used to do it like this [WTD Sales] /[WTD Budget]

But with the formulas I cant figure it out.

J

6 Replies
oscar_ortiz
Partner
Partner

You cannot do it with dynamic labels.  You'll need to use Column(X) / Column(Y) or use Expression X / Expression Y.

This is where variables come in handy.  Replace your expression with a variable then use the variable in your expressions.

$(expWTDSales) / $(expWTDBudget)

Good Luck

Oscar

atkinsow
Specialist II
Specialist II

You can also duplicate these 2 expressions and give the copies static names.  Then hide those columns.

Then you can use the same method you used to do and refer to the static named columns.

Anil_Babu_Samineni

Can you try something like below because you can't use Label into FX functions of Label and it will works only for Expression FX only

= 'Sales ' & max(total Year) & chr(10) & 'Week ' & max(TOTAL [Week No]) & '/' & 'Budget Sales ' & max(total Year) & chr(10) & 'Week ' & max(TOTAL [Week No])


Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
settu_periasamy

I think the below will work

[  $(= 'Sales ' & max(total Year) & chr(10) & 'Week ' & max(TOTAL [Week No])    )]

/

[  $(=  'Budget Sales ' & max(total Year) & chr(10) & 'Week ' & max(TOTAL [Week No])        )]


Note: It will show the expression error, but ignore it.

jadams123
Creator
Creator
Author

no this didn't work..

Do remember that I have 3 columns:

1) = 'Sales ' & max(total Year) & chr(10) & 'Week ' & max(TOTAL [Week No])

2) = 'Budget Sales ' & max(total Year) & chr(10) & 'Week ' & max(TOTAL [Week No])

3) = 'Sales Var % ' & max(total Year) & chr(10) & 'Week ' & max(TOTAL [Week No])

Each of these columns has a different expression. Similar to one below:

=Sum( {$<YEAR = {$(#=Max(YEAR))}, [Week No]= {$(#=Max([Week No]))}, CUSTOMER_TYPE -= {XYZ}, CREDIT_CODE = {YES}>} AMOUNT )

I just want to be able to do sales/budget sales

I am currently doing: column(1)/column(2) in expressions.

I tried settu's example in lables but is wasn't working.

Thanks,

J

settu_periasamy

Hi,

It seems to be working for me..

Can you provide, what did you do?

It should be like

[$(= 'Sales ' & max(total Year) & chr(10) & 'Week ' & max(TOTAL [Week No]) )]

/

[$(= 'Budget Sales ' & max(total Year) & chr(10) & 'Week ' & max(TOTAL [Week No])) ]


Attached the sample