Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

variable

Hello community,

I request your support I have the following table, the value at position 0,243 with the $ (VarResta). when I remove the dimension table Dias. 0243 puts the value as "null" I have proven nuiguna judgments and work for me.

I have also noticed when using the variables, when the sentence is correct the source takes a cursive form. Can anybody give me any suggestions.

Thanks and regards

//sum({$<Dias={'($(VarResta))'}>}Pesostd)

//sum({$<Dias={'($(VarResta))'}>}Pesostd)

//Sum({< Dias = {$(VarResta)} >} Pesostd)

//ONLY({<Dias = {$(VarResta)}>} Pesostd)

if(Dias=($(VarResta)),sum(Pesostd))

//Sum({<Dias = {'$(=Num(VarResta))'}>} Pesostd)

Presentación1.gif

1 Reply
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm not sure that I understand your question completely, but it looks like the correct syntax is in your third commented line:

Sum({< Dias = {$(VarResta)} >} Pesostd)

Assuming that the variable VarResta holds the value 10, this expression should give you the same result as

sum( if(Dias=$(VarResta),Pesostd)

Your other IF expression can only work when Dias remains as part of your dimensions, because it requires that the field Dias has only one possible value. Once you remove Dias from the dimensions, the expression returns NULL because Dias can't be uniquely identified:

if(Dias=($(VarResta)),sum(Pesostd))