Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Label for expression is like
='Current period'&Month
I want to use this expression for calculation later
If you are going to use the same expression in more than one place, and especially if it is a complex expression, then it is a good idea to put the expression text into a document variable. The use the variable name whereever you would use the expression. This not only guarantees that the expression coding is the same in multiple places it also gives you a method for changing the expression in all of those places at once when you change the text in the variable.
Hi,
Your expression is correct. But If there are more than one values for the Month it will display blank.
To test this make a Listbox for the field Month then select one month; that will be the time that the month will be displayed in label.
You can use this code instead:
='Current Period ' & GetFieldSelections(Month)
Regards,
Nadsky
Hi,
Better use Column(Column Number of the Label) function wherever you want to use the label in another expression.
Regards,
Syed.
If you are going to use the same expression in more than one place, and especially if it is a complex expression, then it is a good idea to put the expression text into a document variable. The use the variable name whereever you would use the expression. This not only guarantees that the expression coding is the same in multiple places it also gives you a method for changing the expression in all of those places at once when you change the text in the variable.
Eureka. Thanks you Tim.
At last you've answered a collaboration problem that has been rolling around in my head for some time. How to offer users powerful calculation self-sufficiency without extensive epression training? Most can understand + - / * .
So this sum({$<Year = {$(=max(Year))}, Period = {"<=$(=max({<Year={$(=max(Year))}>} Period))>$(=max({<Year={$(=max(Year))}>} Period)-1)"}>} [Sales Amount])
Become this =CurrentMonthSalesThisYear
And this sum({$<Year = {$(=max(Year))}, Period = {"<=$(=max({<Year={$(=max(Year))}>} Period))"}>} [Sales Amount])
Become this =YTDSalesThisYear
Thanks Again
Rich De Rocco
Hi Tim! I'm a novice in QlikView. I try to make a variable in script like this
set obor=sum(Outcome)/(sum(Salary)/count(DDay))
where Outcome,Salary and DDay are fields.
so, I have PivotTable with expression sum(Outcome)/(sum(Salary)/count(DDay)) (this works) and
expression like =obor - that dont. I try also $(obor) and simply obor - anything works. 😞
Can You help me?
Thats OK with this code - I forget to post ; after set statement, so expression becomes wrong
Thanks Tim!