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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Bitmuster
Contributor II
Contributor II

Correct synax for variables in a table cell

Hi all,

i have a table including several values and a date. I now want to sum up all values from the selected and the previous year. My formula for the previous year is wrong... What would be the correct syntax?

 

sum({<DATUM={(=day(DATUM)).$(=Date(DATUM, 'MM')).$(=year(DATUM)-1)},KST={"102101210"}>}NETTO) 

 

Thank you in advance and best regards

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

The left part within a set analysis must be always an existing field and the right part could be fixed values, search-strings, expressions or variables.

sum({<DATUM = {"$(=addmonths(DATUM, -12))"},KST={"102101210"}>}NETTO) 

 

View solution in original post

3 Replies
PedroNetto
Partner - Creator
Partner - Creator

Hi! You can use AddMonths(DATUM, -12) OR AddYears(DATUM, -1)

Bitmuster
Contributor II
Contributor II
Author

Hi, 

but how?

=sum({$<AddYears(DATUM,-1),KST={"102101210"}>}NETTO) 

My formula is still broken.

Thank you!

marcus_sommer

The left part within a set analysis must be always an existing field and the right part could be fixed values, search-strings, expressions or variables.

sum({<DATUM = {"$(=addmonths(DATUM, -12))"},KST={"102101210"}>}NETTO)