Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
germanmarket
Contributor II
Contributor II

Use another column data inside a expression

Hi, I try without succes to insert into an expression data calculated from another expression:

Here is my initial expression that is working fine:

Sum( {$<DATATRAN.autoCalendar.Date = {">=$(=Min(Date( today(0) - 40 ,'MM/DD/YYYY')))<=$(=Max(today(0)))"},[NRSHOP]={5} >} [VANZARI_OPERATIONALE.CANTITATE])


I am trying to change the fix number marked with red from above with a dynamically calculated number that is stored in another column: Column(3), so the expression should be:

This version of the above expression doesnt work:

Sum( {$<DATATRAN.autoCalendar.Date = {">=$(=Min(Date( today(0) - Column(3),'MM/DD/YYYY')))<=$(=Max(today(0)))"},[NRSHOP]={5} >} [VANZARI_OPERATIONALE.CANTITATE])


Column 3 has this expression that calculate the number, that is different for each record so this is why I cant use a fixed number:

Num(today(0) - FirstSortedValue({$<[RECEPTII.NRSHOP]={5}>}[RECEPTII.DATANIR], -[RECEPTII.DATANIR]))


Any idee how to make this work?

3 Replies
OmarBenSalem

store u expression of column2 into a variable then call ur varibale instead of the column

-$(vUrColumn2Variable)

andrey_krylov
Specialist
Specialist

I think set analysis is not appropriate for this issue, becouse it doesn't calculate for each row. Try to use If() statement instead.

jonathandienst
Partner - Champion III
Partner - Champion III

Andrey is correct. Set expressions are evaluated before the chart detail is created, and Column(3) has no value at that time. A sum(if()) may work for you if the data set is not too large. Otherwise, you will have to rethink your logic.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein