Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
RayWu
Contributor III
Contributor III

How to merge expressions

How can I merge the following two expressions into one?  Thanks  you!

sum({<T3.DateC= {">=$(=AddMonths(Max(T3.DateC), -11))"}>})

Count({<[T3.Amount]={">=$(V1)<=$(V2)"}>}distinct[T3.VendorID])

Labels (2)
4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Its not very clear what you are trying to do. The Sum() expression you posted is incomplete. Do you want to merge the set expressions, get a count of the sums, a sum of the counts, or something else?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
RayWu
Contributor III
Contributor III
Author

I want to count the number of vendorids that meet the conditions.
Such as these 2 conditions, 1. Recent 1 year. 2. The Amount > = $(V1) < = $(V2)
But I don't know how to write them together. I tried using "and" but it didn't work.

sum({<T3.DateC= {">=$(=AddMonths(Max(T3.DateC), -11))"}>}[T3.Amount])

Count({<[T3.Amount]={">=$(V1)<=$(V2)"}>}distinct[T3.VendorID])

Vegar
MVP
MVP

Om Det you dont use END to separate different criteria, but comma (,).

Try this

Count({<

   [T3.Amount]={">=$(V1)<=$(V2)"},

   T3.DateC= {">=$(=AddMonths(Max(T3.DateC), -11))"}

>}distinct[T3.VendorID])

RayWu
Contributor III
Contributor III
Author

I want to count the data after SUM because there are many Amount records.
Can you add "SUM" to it? Or use other methods to sum "Amount" before judging ">=$(V1)<=$(V2)". Thank you!