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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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 - Specialist
Partner - Specialist

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

Anonymous
Not applicable

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])


Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
settu_periasamy
Master III
Master III

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
Master III
Master III

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